summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2013-06-14 12:10:13 +0200
committeryorah <yoram.harmelin@gmail.com>2013-06-14 20:01:35 +0200
commit2da72fb21c1719b34a312dba3ebb7691032cfaa9 (patch)
tree1a31ad153e6b0c1acd514a337105a5609c7725d4
parent4878ea45685c676491575fa7b54d9d9085fd7778 (diff)
downloadlibgit2-2da72fb21c1719b34a312dba3ebb7691032cfaa9.tar.gz
fileops: fix invalid read
-rw-r--r--src/fileops.c2
1 files changed, 1 insertions, 1 deletions
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 */