1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-01 19:26:10 +02:00

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:
Jay Soffian 2008-02-18 05:20:20 -05:00 committed by Junio C Hamano
parent 79a1e6b432
commit b249b552e0

View File

@ -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));