From 2b861d7589467734c2371c4daaab6e540857b988 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Sat, 19 Mar 2011 08:31:40 +0100 Subject: [PATCH] Add detection of incorrect usage to git__joinpath() --- src/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.c b/src/util.c index bfc4f7b27..995daf314 100644 --- a/src/util.c +++ b/src/util.c @@ -223,6 +223,9 @@ void git__joinpath_n(char *buffer_out, int count, ...) int len; path = va_arg(ap, const char *); + + assert((i == 0) || path != buffer_start); + if (i > 0 && *path == '/' && buffer_out > buffer_start && buffer_out[-1] == '/') path++;