grep: correctly initialize help-all option
The "help-all" option is being initialized with a wrong value. While being semantically wrong this can also cause a segmentation fault in gcc on ARMv7 hardfloat platforms with a hardened toolchain. Fix this by initializing with a NULL value. Signed-off-by: Patrick Steinhardt <ps@pks.im> Reviewed-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Apr 9, 2015 at 21:59 UTC
5dcd1b157790232bf0b2c03ed083c8a2ff670663
1 file changed
+1
-1
builtin/grep.c
+1
-1
@@ -740,7 +740,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
740
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
741
OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored,
742
N_("allow calling of grep(1) (ignored by this build)")),
743
- { OPTION_CALLBACK, 0, "help-all", &options, NULL, N_("show usage"),
743
+ { OPTION_CALLBACK, 0, "help-all", NULL, NULL, N_("show usage"),
744
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
745
OPT_END()
746
};