aboutsummaryrefslogtreecommitdiff
path: root/objectheader/parse.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-04 08:26:56 +0800
committerGravatar Runxi Yu2026-03-04 08:59:53 +0800
commitab7501be34032fb9e5c48726a68ae90a917af9eb (patch)
tree20d005647569befea8133e953c3270e8fd2a2a5b /objectheader/parse.go
parent*: gofumpt (diff)
signatureNo signature
*: Lint
Diffstat (limited to 'objectheader/parse.go')
-rw-r--r--objectheader/parse.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/objectheader/parse.go b/objectheader/parse.go
index 72d91d3e..677dffdb 100644
--- a/objectheader/parse.go
+++ b/objectheader/parse.go
@@ -21,6 +21,7 @@ func Parse(data []byte) (objecttype.Type, int64, int, bool) {
if nulRel < 0 {
return objecttype.TypeInvalid, 0, 0, false
}
+
nul := space + 1 + nulRel
ty, ok := objecttype.ParseName(string(data[:space]))
@@ -32,6 +33,7 @@ func Parse(data []byte) (objecttype.Type, int64, int, bool) {
if len(sizeBytes) == 0 {
return objecttype.TypeInvalid, 0, 0, false
}
+
size, err := strconv.ParseInt(string(sizeBytes), 10, 64)
if err != nil || size < 0 {
return objecttype.TypeInvalid, 0, 0, false