From 2da72fb21c1719b34a312dba3ebb7691032cfaa9 Mon Sep 17 00:00:00 2001 From: yorah Date: Fri, 14 Jun 2013 12:10:13 +0200 Subject: [PATCH] fileops: fix invalid read --- src/fileops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileops.c b/src/fileops.c index 02f48e120..ae240fcd2 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -320,7 +320,7 @@ int git_futils_mkdir( min_root_len = git_path_root(make_path.ptr); if (root < min_root_len) root = min_root_len; - while (make_path.ptr[root] == '/') + while (root >= 0 && make_path.ptr[root] == '/') ++root; /* clip root to make_path length */