Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2015 01:09:54 +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-9@freebsd.org
Subject:   svn commit: r292856 - stable/9/usr.sbin/uhsoctl
Message-ID:  <201512290109.tBT19sdB016783@repo.freebsd.org>

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

Log:
  MFstable/10 r292855:
  
  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/9/usr.sbin/uhsoctl/uhsoctl.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/usr.sbin/   (props changed)
  stable/9/usr.sbin/uhsoctl/   (props changed)

Modified: stable/9/usr.sbin/uhsoctl/uhsoctl.c
==============================================================================
--- stable/9/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 29 01:08:58 2015	(r292855)
+++ stable/9/usr.sbin/uhsoctl/uhsoctl.c	Tue Dec 29 01:09:53 2015	(r292856)
@@ -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);



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