File CVE-2024-24577.patch of Package git.35273

Index: b/read-cache.c
===================================================================
--- a/read-cache.c
+++ b/read-cache.c
@@ -1158,10 +1158,13 @@ static int has_dir_name(struct index_sta
 		size_t len;
 
 		for (;;) {
-			if (*--slash == '/')
-				break;
+			slash--;
+
 			if (slash <= ce->name)
 				return retval;
+
+			if (*slash == '/')
+				break;
 		}
 		len = slash - name;
 
openSUSE Build Service is sponsored by