Skip to content

Commit

Permalink
builtin-checkout.c: fix possible usage segfault
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jay Soffian authored and Junio C Hamano committed Feb 19, 2008
1 parent 79a1e6b commit b249b55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
OPT_BOOLEAN( 0 , "track", &opts.track, "track"),
OPT_BOOLEAN('f', NULL, &opts.force, "force"),
OPT_BOOLEAN('m', NULL, &opts.merge, "merge"),
OPT_END(),
};

memset(&opts, 0, sizeof(opts));
Expand Down

0 comments on commit b249b55

Please sign in to comment.