You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Data pointers past 2 GiB are sign-extended and unreachable #435
Invalid position error: data pointers past 2 GiB are unreachable
Since 4.0.0 the reader supports files larger than 2 GB (#289), but Decoder.decodePointer still
decodes the pointer payload into an int. Any data-section offset >= 2^31 wraps negative, and the
subsequent Buffer.position(...) rejects it.
Affected: 4.0.2, 4.1.0, and current main (all identical on this path).
Symptom
java.lang.IllegalArgumentException: Invalid position: -821410056
at com.maxmind.db.MultiBuffer.position(MultiBuffer.java:...)
at com.maxmind.db.Decoder.decode(...)
at com.maxmind.db.NoCache.get(NoCache.java:17)
at com.maxmind.db.Decoder.decodePointer(...)
-821410056 + 2^32 = 3473557240, a valid offset inside the real production ~3.4 GB database being read. Every
lookup that resolves to a record past the 2 GiB line fails; everything below it works normally.
decodeInteger returns int, so packed is sign-extended by the implicit widening in the
addition. decodeUint32 in the same class already avoids this by going through decodeLong.
Activity