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>
This commit is contained in:
committed by
Junio C Hamano
parent
79a1e6b432
commit
b249b552e0
@ -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));
|
||||
|
||||
Reference in New Issue
Block a user