svn commit: r358518 - head/usr.bin/elfctl

Kyle Evans kevans at FreeBSD.org
Mon Mar 2 04:22:40 UTC 2020


Author: kevans
Date: Mon Mar  2 04:22:38 2020
New Revision: 358518
URL: https://svnweb.freebsd.org/changeset/base/358518

Log:
  elfctl: initialize features
  
  GCC points out a couple levels down in convert_to_features that this may be
  used uninitialized. Indeed, this is true- initialize it to NULL so that we
  at least deref a null pointer.

Modified:
  head/usr.bin/elfctl/elfctl.c

Modified: head/usr.bin/elfctl/elfctl.c
==============================================================================
--- head/usr.bin/elfctl/elfctl.c	Mon Mar  2 02:47:56 2020	(r358517)
+++ head/usr.bin/elfctl/elfctl.c	Mon Mar  2 04:22:38 2020	(r358518)
@@ -92,6 +92,7 @@ main(int argc, char **argv)
 	lflag = 0;
 	editfeatures = 0;
 	retval = 0;
+	features = NULL;
 
 	if (elf_version(EV_CURRENT) == EV_NONE)
 		errx(EXIT_FAILURE, "elf_version error");


More information about the svn-src-all mailing list