summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/regex/main.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-07 08:28:41 +0000
committerngie <ngie@FreeBSD.org>2017-01-07 08:28:41 +0000
commitfdbb1c88bd9b5d8aacdf1d008229e25d3037382a (patch)
tree153bd56a640f967060b3a28e2fdcdda9ef89596c /contrib/netbsd-tests/lib/libc/regex/main.c
parent8204431b706c0df4fe47b721c5618da77daf0f91 (diff)
downloadFreeBSD-src-fdbb1c88bd9b5d8aacdf1d008229e25d3037382a.zip
FreeBSD-src-fdbb1c88bd9b5d8aacdf1d008229e25d3037382a.tar.gz
MFC r310954,r310987,r311222:
r310954: Set value->v.octetstring.len to a correct value on malloc success/failure The previous code always set value->v.octetstring.len to len, regardless of the result from the malloc call. This misleads the caller on malloc failure. Set .len to len on success and 0 on failure. CID: 1007590 r310987: snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not on the stack Some of the callers try to determine whether or not `object` is valid by testing the value for NULL, which will never be true if it's a stack value, so in order to be clear and correct down the call stack, use a heap allocated object. This also addresses a Coverity issue by initializing all of `object` via calloc CID: 1006392 r311222: Fix logical inversion when checking result from calloc in snmp_output_err_resp(..) CID: 1368195
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/regex/main.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud