mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 20:29:27 +00:00
Merge pull request #3534 from ethomson/index_canonicalize_fix
index: canonicalize inserted paths safely
This commit is contained in:
commit
2d36e145d9
@ -1167,7 +1167,7 @@ static int canonicalize_directory_path(
|
|||||||
while ((match = git_vector_get(&index->entries, pos))) {
|
while ((match = git_vector_get(&index->entries, pos))) {
|
||||||
if (GIT_IDXENTRY_STAGE(match) != 0) {
|
if (GIT_IDXENTRY_STAGE(match) != 0) {
|
||||||
/* conflicts do not contribute to canonical paths */
|
/* conflicts do not contribute to canonical paths */
|
||||||
} else if (memcmp(search, match->path, search_len) == 0) {
|
} else if (strncmp(search, match->path, search_len) == 0) {
|
||||||
/* prefer an exact match to the input filename */
|
/* prefer an exact match to the input filename */
|
||||||
best = match;
|
best = match;
|
||||||
best_len = search_len;
|
best_len = search_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user