Unverified Commit 6f525a19 by Patrick Steinhardt Committed by GitHub

Merge pull request #4797 from bisho/patch-2

Prevent heap-buffer-overflow
parents 045cc321 d22cd1f4
...@@ -210,7 +210,7 @@ static int packfile_load__cb(void *data, git_buf *path) ...@@ -210,7 +210,7 @@ static int packfile_load__cb(void *data, git_buf *path)
for (i = 0; i < backend->packs.length; ++i) { for (i = 0; i < backend->packs.length; ++i) {
struct git_pack_file *p = git_vector_get(&backend->packs, i); struct git_pack_file *p = git_vector_get(&backend->packs, i);
if (memcmp(p->pack_name, path_str, cmp_len) == 0) if (strncmp(p->pack_name, path_str, cmp_len) == 0)
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment