From 6ce9432d755104c8fb6afe82ddcdfc905d498da7 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 7 Oct 2006 14:19:00 +0000 Subject: [PATCH] A bug-fix for die_on_unsafe_path() when the path doesn't exist. --- util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index d8d396cf..afff767d 100644 --- a/util.c +++ b/util.c @@ -922,7 +922,8 @@ void die_on_unsafe_path(char *path, int strip_filename) if ((p = strchr(p, '/')) != NULL) *p = '\0'; if (safe_stat(path, &st) < 0) { - *p++ = '/'; + if (p) + *p = '/'; goto done; } if (S_ISLNK(st.st_mode)) { -- 2.34.1