leerho commented on code in PR #576:
URL: https://github.com/apache/datasketches-cpp/pull/576#discussion_r4591171681
##########
count/include/count_min_impl.hpp:
##########
@@ -460,6 +500,8 @@ void count_min_sketch<W,A>::check_header_validity(uint8_t
preamble_longs, uint8_
switch (sw) { // exhaustive list and description of all valid cases
Review Comment:
Good catch, thanks. Because the check only compared a weighted sum, some
wrong headers did pass: for example serial version 0 with family ID 19, serial
version 3 with family ID 17, or preamble longs 10 instead of 2. The first case
would even have been read as a version 2 sketch. Fixed in a7519269: preamble
longs, serial version and family ID are now each checked on their own, as Java
does, and the error message names the field that is wrong. The new test "count
min v2: each header field is checked" covers those cases (and two simpler ones)
for both the byte and the stream deserializers. It fails without the change.
--
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]