Skip to content

Commit 5dcd1b1

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Reviewed-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 282616c commit 5dcd1b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/grep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
740740
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
741741
OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored,
742742
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"),
744744
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
745745
OPT_END()
746746
};

0 commit comments

Comments
 (0)