Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-07 02:41:01 +0400
committerJunio C Hamano <gitster@pobox.com>2012-09-07 03:19:58 +0400
commit3efe5d1d32fde899b23ebbb1fde499a0897e1c4e (patch)
tree5bfe709bf2c890f6160f73ba1bd00aeda6d03e40 /abspath.c
parenta5c45218b63ce7ac6f5a4a48c4312a1e37e01f3f (diff)
real_path(): reject the empty string
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index 5d624307d5..3e8325c736 100644
--- a/abspath.c
+++ b/abspath.c
@@ -35,6 +35,9 @@ const char *real_path(const char *path)
if (path == buf || path == next_buf)
return path;
+ if (!*path)
+ die("The empty string is not a valid path");
+
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
die ("Too long path: %.*s", 60, path);