svn commit: r292585 - head/usr.sbin/uhsoctl

Garrett Cooper ngie at FreeBSD.org
Tue Dec 22 05:57:24 UTC 2015


Author: ngie
Date: Tue Dec 22 05:57:23 2015
New Revision: 292585
URL: https://svnweb.freebsd.org/changeset/base/292585

Log:
  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 at isilon.com>
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/uhsoctl/uhsoctl.c

Modified: head/usr.sbin/uhsoctl/uhsoctl.c
==============================================================================
--- head/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 22 03:07:38 2015	(r292584)
+++ head/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 22 05:57:23 2015	(r292585)
@@ -452,6 +452,7 @@ set_nameservers(struct ctx *ctx, const c
 			free(ctx->ns[i]);
 		}
 		free(ctx->ns);
+		ctx->ns = NULL;
 	}
 
 	fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666);


More information about the svn-src-all mailing list