diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-22 05:57:23 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-22 05:57:23 +0000 |
commit | ea1e84c5daeeadfa18d1ba6af4be01d2031272d7 (patch) | |
tree | 76d8104eb1815cf9a6e6ce9bd0fc4ec929e8f704 /usr.sbin | |
parent | 60471ce30ea4b3f7cad7cb2a6ffff575429750e0 (diff) | |
download | FreeBSD-src-ea1e84c5daeeadfa18d1ba6af4be01d2031272d7.zip FreeBSD-src-ea1e84c5daeeadfa18d1ba6af4be01d2031272d7.tar.gz |
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>
MFC after: 1 week
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 686d45f..9dc13ab 100644 --- a/usr.sbin/uhsoctl/uhsoctl.c +++ b/usr.sbin/uhsoctl/uhsoctl.c @@ -452,6 +452,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); |