fix(pathdb): use MaxInt instead of MaxUint32 for int overflow check

This commit is contained in:
David Klank 2025-12-04 11:59:16 +02:00 committed by GitHub
parent 657c99f116
commit 4a582b6881
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -404,7 +404,7 @@ func decodeSingle(keySection []byte, onValue func([]byte, int, int) error) ([]st
keyOff += nn keyOff += nn
// Validate that the values can fit in an int to prevent overflow on 32-bit systems // Validate that the values can fit in an int to prevent overflow on 32-bit systems
if nShared > uint64(math.MaxUint32) || nUnshared > uint64(math.MaxUint32) || nValue > uint64(math.MaxUint32) { if nShared > uint64(math.MaxInt) || nUnshared > uint64(math.MaxInt) || nValue > uint64(math.MaxInt) {
return nil, errors.New("key size too large") return nil, errors.New("key size too large")
} }