Skip to content

Commit 113656e

Browse files
committed
Merge branch 'zh/read-cache-copy-name-entry-fix'
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
2 parents 2246937 + 6d85834 commit 113656e

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

read-cache.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,8 +1944,6 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool,
19441944
ce->ce_namelen = len;
19451945
ce->index = 0;
19461946
oidread(&ce->oid, ondisk->data);
1947-
memcpy(ce->name, name, len);
1948-
ce->name[len] = '\0';
19491947

19501948
if (expand_name_field) {
19511949
if (copy_len)

0 commit comments

Comments
 (0)