From: Alex Riesen Date: Thu, 28 Feb 2008 16:30:47 +0000 (+0100) Subject: Fix builtin checkout crashing when given an invalid path X-Git-Tag: v1.5.5-rc0~123 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=301e42edc3fa277059be97b3be5b97d86ddc9d9f;p=git.git Fix builtin checkout crashing when given an invalid path Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/builtin-checkout.c b/builtin-checkout.c index 4a4bb8b77..9579ff4ab 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -545,6 +545,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) if (argc) { const char **pathspec = get_pathspec(prefix, argv); + + if (!pathspec) + die("invalid path specification"); + /* Checkout paths */ if (opts.new_branch || opts.force || opts.merge) { if (argc == 1) {