diff options
| author | 2026-03-28 16:16:28 +0000 | |
|---|---|---|
| committer | 2026-03-28 16:16:28 +0000 | |
| commit | 2d1fe758bbac52b3605e9f519bbaac714f0d92c9 (patch) | |
| tree | e0dba07fd6fe99186358a1993544c6b2824bcc34 /object | |
| parent | object/store/packed: Expect length and verify Adler-32 (diff) | |
| signature | No signature | |
object/store/{loose,packed}: TIghten language around Adler-32
Diffstat (limited to 'object')
| -rw-r--r-- | object/store/loose/read_bytes.go | 6 | ||||
| -rw-r--r-- | object/store/packed/read_bytes.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/object/store/loose/read_bytes.go b/object/store/loose/read_bytes.go index 87a9f020..5ed3b82b 100644 --- a/object/store/loose/read_bytes.go +++ b/object/store/loose/read_bytes.go @@ -30,8 +30,8 @@ func (store *Store) readBytesParsed(id objectid.ObjectID) ([]byte, objecttype.Ty // ReadBytesFull reads a full serialized object as "type size\0content". // -// It inflates and parses the full loose object, including consuming the zlib -// stream through its Adler-32 trailer. +// It inflates and parses the full loose object, including verifying the zlib +// Adler-32 trailer. func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error) { raw, _, _, err := store.readBytesParsed(id) if err != nil { @@ -44,7 +44,7 @@ func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error) { // ReadBytesContent reads an object's type and content bytes. // // Like ReadBytesFull, it inflates and parses the full loose object, including -// consuming the zlib stream through its Adler-32 trailer. +// verifying the zlib Adler-32 trailer. func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error) { _, ty, content, err := store.readBytesParsed(id) if err != nil { diff --git a/object/store/packed/read_bytes.go b/object/store/packed/read_bytes.go index 98ae6995..222d9a05 100644 --- a/object/store/packed/read_bytes.go +++ b/object/store/packed/read_bytes.go @@ -12,7 +12,7 @@ import ( // // It fully resolves the requested object bytes. For base pack entries, this // includes verifying that the zlib stream inflates to exactly the declared -// object size and reaches its Adler-32 trailer. +// object size and verifying the Adler-32 trailer. func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error) { loc, err := store.lookup(id) if err != nil { @@ -26,7 +26,7 @@ func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []b // // Like ReadBytesContent, it fully resolves the requested object bytes. For // base pack entries, this includes verifying that the zlib stream inflates to -// exactly the declared object size and reaches its Adler-32 trailer. +// exactly the declared object size and verifying the Adler-32 trailer. func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error) { ty, content, err := store.ReadBytesContent(id) if err != nil { |
