Skip to content

Commit

Permalink
Removing 'logically impossible'
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Sep 26, 2023
1 parent 4d10907 commit 727493c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/roaring_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ size_t ra_portable_deserialize_size(const char *buf, const size_t maxbytes) {
buf += sizeof(uint32_t);
}
if (size > (1<<16)) {
return 0; // logically impossible
return 0;
}
char *bitmapOfRunContainers = NULL;
bool hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE;
Expand Down Expand Up @@ -728,11 +728,11 @@ bool ra_portable_deserialize(roaring_array_t *answer, const char *buf, const siz
}
if (size < 0) {
// You cannot have a negative number of containers, the data must be corrupted.
return false; // logically impossible
return false;
}
if (size > (1<<16)) {
// You cannot have so many containers, the data must be corrupted.
return false; // logically impossible
return false;
}
const char *bitmapOfRunContainers = NULL;
bool hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE;
Expand Down

0 comments on commit 727493c

Please sign in to comment.