diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-06-14 00:53:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-06-14 00:53:43 +0200 |
commit | 113656eca6c58b8db61c3c8e8218f7debe33708a (patch) | |
tree | 5528ce89526e0afc2a23813a0a82152694b9115f /read-cache.c | |
parent | Merge branch 'tb/show-ref-optim' (diff) | |
parent | read-cache.c: reduce unnecessary cache entry name copying (diff) | |
download | git-113656eca6c58b8db61c3c8e8218f7debe33708a.tar.xz git-113656eca6c58b8db61c3c8e8218f7debe33708a.zip |
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
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c index 96ce489c7c..e61af3a3d4 100644 --- a/read-cache.c +++ b/read-cache.c @@ -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) |