Browse Source

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>
maint
Jay Soffian 17 years ago committed by Junio C Hamano
parent
commit
b249b552e0
  1. 1
      builtin-checkout.c

1
builtin-checkout.c

@ -545,6 +545,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) @@ -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));

Loading…
Cancel
Save