diff options
author | ngie <ngie@FreeBSD.org> | 2017-01-07 08:28:51 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-01-07 08:28:51 +0000 |
commit | b6903072edd16b3e4bdb742fb6249a7c2430b4c0 (patch) | |
tree | c332a3535ac09b8ef9e9174fcfaf79bc3310bc5e /contrib/netbsd-tests/lib/libc/stdlib/t_random.c | |
parent | 733659d4511f6c512213b585fa20b5fb34c10761 (diff) | |
download | FreeBSD-src-b6903072edd16b3e4bdb742fb6249a7c2430b4c0.zip FreeBSD-src-b6903072edd16b3e4bdb742fb6249a7c2430b4c0.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/stdlib/t_random.c')
0 files changed, 0 insertions, 0 deletions