aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-22 08:00:00 +0800
committerGravatar Runxi Yu2025-11-22 08:00:00 +0800
commit36bb1539b226522253934a8a6cabdb1c8dacca1b (patch)
tree4eae4f54f3d9d8296965268b3fb1c23d0b5dec5f
parentzlib, flatex: Remove code related to dicts (diff)
signatureNo signature
pack: Allocate the header on the stack instead
-rw-r--r--pack_pack.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pack_pack.go b/pack_pack.go
index 99f885a1..1b98bcca 100644
--- a/pack_pack.go
+++ b/pack_pack.go
@@ -506,7 +506,8 @@ func openPackFile(absPath, rel string) (*packFile, error) {
return nil, ErrInvalidObject
}
- header := make([]byte, 12)
+ var headerArr [12]byte
+ header := headerArr[:]
_, err = io.ReadFull(f, header)
if err != nil {
_ = f.Close()