Commit 744d83886edb002d336c66f41936b6dda64a0f9c

Edward Thomson 2018-09-18T02:59:45

Merge pull request #4805 from libgit2/signed_char path validation: `char` is not signed by default.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/path.c b/src/path.c
index e411f35..c8bc8d4 100644
--- a/src/path.c
+++ b/src/path.c
@@ -1662,7 +1662,7 @@ GIT_INLINE(bool) verify_dotgit_ntfs_generic(const char *name, size_t len, const 
 			saw_tilde = 1;
 		} else if (i >= 6) {
 			return true;
-		} else if (name[i] < 0) {
+		} else if ((unsigned char)name[i] > 127) {
 			return true;
 		} else if (git__tolower(name[i]) != shortname_pfix[i]) {
 			return true;