summaryrefslogtreecommitdiff
path: root/openbsd-compat/regress/strduptest.c
diff options
context:
space:
mode:
authorschwarze@openbsd.org <schwarze@openbsd.org>2016-05-30 12:05:56 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-06-06 11:27:38 +1000
commitac284a355f8065eaef2a16f446f3c44cdd17371d (patch)
treede00e4236e35e385771974e7daedec02a4064f0f /openbsd-compat/regress/strduptest.c
parent0e059cdf5fd86297546c63fa8607c24059118832 (diff)
upstream commit
Fix two rare edge cases: 1. If vasprintf() returns < 0, do not access a NULL pointer in snmprintf(), and do not free() the pointer returned from vasprintf() because on some systems other than OpenBSD, it might be a bogus pointer. 2. If vasprintf() returns == 0, return 0 and "" rather than -1 and NULL. Besides, free(dst) is pointless after failure (not a bug). One half OK martijn@, the other half OK deraadt@; committing quickly before people get hurt. Upstream-ID: b7bcd2e82fc168a8eff94e41f5db336ed986fed0
Diffstat (limited to 'openbsd-compat/regress/strduptest.c')
0 files changed, 0 insertions, 0 deletions