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 <[email protected]>
  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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to