Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2015 01:08:58 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r292855 - stable/10/usr.sbin/uhsoctl
Message-ID:  <201512290108.tBT18w7i016689@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Tue Dec 29 01:08:58 2015
New Revision: 292855
URL: https://svnweb.freebsd.org/changeset/base/292855

Log:
  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

Modified:
  stable/10/usr.sbin/uhsoctl/uhsoctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/uhsoctl/uhsoctl.c
==============================================================================
--- stable/10/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 29 01:08:07 2015	(r292854)
+++ stable/10/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 29 01:08:58 2015	(r292855)
@@ -453,6 +453,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512290108.tBT18w7i016689>