Repository navigation
Releases
Releases · oschwald/maxminddb-rust
0.33.0
- Breaking:
deserialize_newtype_structnow calls the visitor's
visit_newtype_struct. Before, it passed the inner value straight to
methods such asvisit_strorvisit_map. Derived Serde newtypes around
scalars, strings, and records now deserialize, including nested wrappers
and pointer-backed values. A hand-written visitor that does not implement
visit_newtype_structnow fails with an invalid type error. See
UPGRADING.md. - Declared a minimum supported Rust version (MSRV) of 1.77 in
Cargo.toml.
CI now builds the library with that version. - Fixed
networks()andwithin()dropping IPv6 networks that share a terminal
data record or no-data sentinel with the IPv4 search start. IPv4 subtree
aliases are still filtered by default. - Fixed decoding of four-byte data pointers with control bytes 0x3D-0x3F.
The decoder read their ignored low bits as an extended payload length and
could return the wrong value or an error. Four-byte pointers with other
control bytes decoded correctly. - Added automatic prefix tables to speed up lookups, using 1,360 bytes per
reader (8 IPv4 bits and 4 IPv6 bits). Building them adds a small one-time
cost to opening a reader. - Reduced decoder error-handling code on successful paths. Validation and
error behavior are unchanged. - Added a workload benchmark that separates tree traversal, record decoding,
and reader construction, with hit counts and JSON timing results.
0.32.0
- Reused precharged map-key bytes for raw identifier decoding, avoiding a
second header parse while preserving payload limits and other Serde entry
points. Added raw-string adapter and generic JSON decoding benchmarks. - Breaking: Removed the
simdutf8feature and its optional dependency. It did
not improve lookup performance in benchmarks using production GeoIP2 City
and Country databases. Removesimdutf8from dependency feature lists when
upgrading. - Improved record decoding performance by reducing internal error storage
and streamlining pointer and payload decoding. Public error types and
validation limits are unchanged. - Fixed decoder cursor restoration when a typed pointer exceeds the nesting
limit. - Improved search-tree lookup performance for 24-bit and 28-bit databases
by reading each child pointer from a single word within the node. - Improved
decode_path()performance by specializing map-key header
decoding for inline strings and all pointer widths, including long keys.
0.31.0
- Fixed a denial-of-service issue when decoding records or metadata. A
crafted database could repeatedly reference shared data, causing excessive
CPU and memory use. Decoding now limits the number of values and the amount
of string and byte data expanded in a single operation. Operations that
exceed these limits returnMaxMindDbError::ResourceLimit. - Limited subdivision lists in the built-in City and Enterprise types to 32
entries to prevent excessive allocation from untrusted data. Reader::verify()now checks data referenced by unknown metadata fields.- Limited the work performed by
Reader::verify()to prevent excessive CPU
use from databases with overlapping string payloads. Verification returns
MaxMindDbError::ResourceLimitwhen this limit is exceeded. - Improved record decoding performance by accelerating short ASCII string
validation and inlining decoding entry points.
0.30.3
0.30.2
0.30.0
- Added
deserialize_any_with_raw_strings()for Serde-based format adapters
to validate MMDB strings while constructing another runtime's native string
type, avoiding duplicate UTF-8 validation without unsafe Rust. Adapters
remain responsible for strict UTF-8 validation. - Fixed network iteration on cyclic or over-deep corrupt search trees so it
returns an error instead of looping indefinitely. - Fixed
decode_path()error rendering for extreme negative indexes and
reduced path traversal header parsing. - Removed decoder logging checks from hot deserialization paths.
- Fixed
verify()to validate shared data-section pointer targets once, reject
pointer cycles, invalid scalar encodings, and impossible container sizes.
0.29.0
- Breaking:
Metadata::build_time()now returns
Result<SystemTime, MaxMindDbError>instead of panicking on
unrepresentable timestamps, and databases whosebuild_epochcannot be
represented asSystemTimeare rejected as invalid during open and verify. - Breaking:
Reader::metadatais now private. UseReader::metadata()to
access validated metadata by shared reference. - Breaking: Opening a database now rejects unsupported major format versions,
unsupported IP versions, and zero-node search trees. Minor format versions
are still accepted for forward compatibility. - Fixed:
within()andnetworks()now handle IPv6 databases without an
IPv4 subtree without reading terminal data nodes as tree nodes or
panicking while formatting low IPv6 networks. - Fixed: Skipping ignored or unknown fields now enforces data-section
bounds and the maximum nesting depth instead of accepting truncated
values or overflowing the stack on deeply nested corrupt data. - Internal: Added focused benchmarks for network iteration and serde
unknown-field skipping, plus metadata build-time conversion, to guard
performance-sensitive fixes. - Documentation: Fixed intra-doc links so docs build with warnings denied,
and added a CI check to keep them passing.
0.28.1
- Fixed: Databases with an impossible declared search tree size are now
rejected during open/verify instead of causing runaway allocation
during validation. - Fixed:
within()now rejects IPv6 CIDRs on IPv4-only databases instead
of yielding unrelated networks. - Fixed: Verification now rejects truncated scalar/string payloads instead
of skipping past them and reporting the database as valid. - Fixed:
LookupResult::network()now uses the reader's measured IPv4
subtree depth instead of assuming it always begins at bit 96.
0.28.0
- Performance improvement: Faster search-tree traversal by dispatching
on the database's record size to monomorphized node readers, replacing
per-step branching on the record size. - Performance improvement: Direct deserialization of scalars, sequences,
maps, and structs through dedicated fast paths instead of routing
throughdeserialize_any. - Performance improvement: IPv4 and IPv6 lookups dispatch to dedicated
paths, avoiding per-call address-kind checks on the hot path. - Behavior change: Deserializing a database array into a tuple or
tuple struct now returns a decoding error when the lengths do not
match. Previously the mismatch was silently ignored. - Fixed: A corrupt data pointer that would underflow during resolution
now returns anInvalidDatabaseerror instead of panicking.