Skip to content

Commit b249b55

Browse files
jaysoffiangitster
authored andcommitted
builtin-checkout.c: fix possible usage segfault
Not terminating the options[] array with OPT_END can cause usage ("git checkout -h") output to segfault. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 79a1e6b commit b249b55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin-checkout.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
545545
OPT_BOOLEAN( 0 , "track", &opts.track, "track"),
546546
OPT_BOOLEAN('f', NULL, &opts.force, "force"),
547547
OPT_BOOLEAN('m', NULL, &opts.merge, "merge"),
548+
OPT_END(),
548549
};
549550

550551
memset(&opts, 0, sizeof(opts));

0 commit comments

Comments
 (0)