From 301e42edc3fa277059be97b3be5b97d86ddc9d9f Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 28 Feb 2008 17:30:47 +0100 Subject: [PATCH] Fix builtin checkout crashing when given an invalid path Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- builtin-checkout.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.30.2