Skip to content

Commit

Permalink
Merge branch 'zh/read-cache-copy-name-entry-fix'
Browse files Browse the repository at this point in the history
Remove redundant copying (with index v3 and older) or possible
over-reading beyond end of mmapped memory (with index v4) has been
corrected.

* zh/read-cache-copy-name-entry-fix:
  read-cache.c: reduce unnecessary cache entry name copying
  • Loading branch information
gitster committed Jun 13, 2022
2 parents 2246937 + 6d85834 commit 113656e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions read-cache.c
Expand Up @@ -1944,8 +1944,6 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
ce->ce_namelen = len;
ce->index = 0;
oidread(&ce->oid, ondisk->data);
memcpy(ce->name, name, len);
ce->name[len] = '\0';

if (expand_name_field) {
if (copy_len)
Expand Down

0 comments on commit 113656e

Please sign in to comment.