Fix for
*** CID
1457529: Error handling issues (CHECKED_RETURN)
/librpc/ndr/ndr_basic.c: 786 in ndr_push_full_ptr()
...
ID
1457529: Error handling issues (CHECKED_RETURN)
Calling "ndr_token_store" without checking return value (as is done
elsewhere 14 out of 17 times).
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Thu Jan 9 21:49:00 UTC 2020 on sn-devel-184
/* Check if the pointer already exists and has an id */
ptr = ndr_token_peek(&ndr->full_ptr_list, p);
if (ptr == 0) {
+ enum ndr_err_code ret = NDR_ERR_SUCCESS;
ndr->ptr_count++;
ptr = ndr->ptr_count;
- ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
+ ret = ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
+ if (ret != NDR_ERR_SUCCESS) {
+ return ret;
+ }
}
}
return ndr_push_uint3264(ndr, NDR_SCALARS, ptr);