diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 08:28:41 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 08:28:41 +0000 |
commit | fdbb1c88bd9b5d8aacdf1d008229e25d3037382a (patch) | |
tree | 153bd56a640f967060b3a28e2fdcdda9ef89596c /contrib/netbsd-tests/lib/libc/regex/test_regex.h | |
parent | 8204431b706c0df4fe47b721c5618da77daf0f91 (diff) | |
download | FreeBSD-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/test_regex.h')
0 files changed, 0 insertions, 0 deletions