From: Patrick Steinhardt Date: Thu, 9 Apr 2015 19:59:06 +0000 (+0200) Subject: grep: correctly initialize help-all option X-Git-Tag: v2.4.0-rc3~4^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5dcd1b157790232bf0b2c03ed083c8a2ff670663?ds=inline;hp=--cc 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 Reviewed-by: René Scharfe Signed-off-by: Junio C Hamano --- 5dcd1b157790232bf0b2c03ed083c8a2ff670663 diff --git a/builtin/grep.c b/builtin/grep.c index b8d440d0e0..709d20eb9e 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -740,7 +740,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager }, OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored, N_("allow calling of grep(1) (ignored by this build)")), - { OPTION_CALLBACK, 0, "help-all", &options, NULL, N_("show usage"), + { OPTION_CALLBACK, 0, "help-all", NULL, NULL, N_("show usage"), PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback }, OPT_END() };