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

Reply via email to