Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitmap64: fix memory access error #2344

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/lib/ndpi_bitmap64.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ bool ndpi_bitmap64_isset(ndpi_bitmap64 *_b, u_int64_t value) {
if(!b)
return(false);

if(!b->is_compressed) ndpi_bitmap64_compress(b);
if(!b->is_compressed) {
if(!ndpi_bitmap64_compress(b))
return(false); /* Compresssion failed */
}

return(binary_fuse16_contain(value, &b->bitmap));
}
Expand All @@ -200,7 +203,11 @@ u_int32_t ndpi_bitmap64_size(ndpi_bitmap64 *_b) {
ndpi_bitmap64_t *b = (ndpi_bitmap64_t*)_b;

if(!b) return(0);
if(!b->is_compressed) ndpi_bitmap64_compress(b);


if(!b->is_compressed) {
if(!ndpi_bitmap64_compress(b))
return(0); /* Compresssion failed */
}

return(sizeof(ndpi_bitmap64) + binary_fuse16_size_in_bytes(&b->bitmap));
}
Loading