]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tree-walk.c
Git 2.17.3
[thirdparty/git.git] / tree-walk.c
index 63a87ed666bbb10cb3c2bd0e27117ac696e7d1b3..3966b0ae44a5136a5a48ed14ed745fa73b0de93a 100644 (file)
@@ -41,6 +41,12 @@ static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l
                strbuf_addstr(err, _("empty filename in tree entry"));
                return -1;
        }
+#ifdef GIT_WINDOWS_NATIVE
+       if (protect_ntfs && strchr(path, '\\')) {
+               strbuf_addf(err, _("filename in tree entry contains backslash: '%s'"), path);
+               return -1;
+       }
+#endif
        len = strlen(path) + 1;
 
        /* Initialize the descriptor entry */