From fdafb99d81ae0ee65863ba6c419c50b7a39d5b51 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Mon, 2 Mar 2020 04:22:38 +0000 Subject: [PATCH] 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. --- usr.bin/elfctl/elfctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index 1eaa0fb86181..abc2758b8acc 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -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");