jaideeppyne commented on PR #224:
URL: 
https://github.com/apache/datasketches-rust/pull/224#issuecomment-5412946972

   Good catch — you're right that `(30, 30)` slipped through and the empty path 
was still sizing the map straight from the header. I pushed a follow-up: the 
empty case now builds the map at `LG_MIN_MAP_SIZE` (matching the Java/C++ 
heapify, which ignores `lg_cur` when the sketch is empty), so 
`[1,1,10,30,30,5,0,0]` deserializes to an empty sketch instead of reaching 
`new(1 << 30)`. On the non-empty path I also reject headers whose 
`active_items` is inconsistent with `lg_cur_map_size`, or larger than the 
remaining bytes can hold, so the count can't drive an oversized 
`Vec::with_capacity` either. Added regression tests for all three; the existing 
C++/Java/Go round-trip fixtures still pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to