diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-29 01:08:58 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-29 01:08:58 +0000 |
commit | 6a3209fa7085d7589c9a7ce26e2616583bb6d964 (patch) | |
tree | d2010bd34ed365d0e1ae796bde5d3e93940acb7b /usr.sbin | |
parent | 5d20de4a86d8a94c79847288c10ae3de90145c67 (diff) | |
download | FreeBSD-src-6a3209fa7085d7589c9a7ce26e2616583bb6d964.zip FreeBSD-src-6a3209fa7085d7589c9a7ce26e2616583bb6d964.tar.gz |
MFC r292585:
Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on
Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/uhsoctl/uhsoctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/uhsoctl/uhsoctl.c b/usr.sbin/uhsoctl/uhsoctl.c index 21b6220..92efed8 100644 --- a/usr.sbin/uhsoctl/uhsoctl.c +++ b/usr.sbin/uhsoctl/uhsoctl.c @@ -453,6 +453,7 @@ set_nameservers(struct ctx *ctx, const char *respath, int ns, ...) free(ctx->ns[i]); } free(ctx->ns); + ctx->ns = NULL; } fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666); |