Skip to content

Commit 6f525a1

Browse files
authored
Merge pull request libgit2#4797 from bisho/patch-2
Prevent heap-buffer-overflow
2 parents 045cc32 + d22cd1f commit 6f525a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/odb_pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int packfile_load__cb(void *data, git_buf *path)
210210
for (i = 0; i < backend->packs.length; ++i) {
211211
struct git_pack_file *p = git_vector_get(&backend->packs, i);
212212

213-
if (memcmp(p->pack_name, path_str, cmp_len) == 0)
213+
if (strncmp(p->pack_name, path_str, cmp_len) == 0)
214214
return 0;
215215
}
216216

0 commit comments

Comments
 (0)