Skip to content

Validate user input with roaring_bitmap_internal_validate#50

Merged
ChenHuajun merged 1 commit intoChenHuajun:masterfrom
andreas:internal-validate
Sep 14, 2025
Merged

Validate user input with roaring_bitmap_internal_validate#50
ChenHuajun merged 1 commit intoChenHuajun:masterfrom
andreas:internal-validate

Conversation

@andreas
Copy link
Copy Markdown
Contributor

@andreas andreas commented Sep 8, 2025

This PR adds roaring_bitmap_internal_validate to rb_from_bytea and roaringbitmap_in. From the documentation:

pg_roaringbitmap/roaring.h

Lines 2132 to 2145 in 75f84d4

/**
* Perform internal consistency checks. Returns true if the bitmap is
* consistent. It may be useful to call this after deserializing bitmaps from
* untrusted sources. If roaring_bitmap_internal_validate returns true, then the
* bitmap should be consistent and can be trusted not to cause crashes or memory
* corruption.
*
* Note that some operations intentionally leave bitmaps in an inconsistent
* state temporarily, for example, `roaring_bitmap_lazy_*` functions, until
* `roaring_bitmap_repair_after_lazy` is called.
*
* If reason is non-null, it will be set to a string describing the first
* inconsistency found if any.
*/

See #42.

@ChenHuajun ChenHuajun merged commit 543f138 into ChenHuajun:master Sep 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants