RoaringBitmap / RoaringBitmap/roaring
(code might give the impression of possible) integer overflows in binary search
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.9k
- Forks
- 262
- Avg merge
- 2h 34m
- Merged PRs (30d)
- 8
Description
Both the C and the java binary search implementations are subject to a classic integer overflow bug in binary search; e.g. at
https://github.com/RoaringBitmap/CRoaring/blob/master/include/roaring/containers/run.h#L91
instead of
int32_t middleIndex = (low + high) >> 1;
prefer:
int32_t middleIndex = low + ((high-low) >> 1);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/roaring/containers/run.h at the linked binary-search code, then locate the corresponding Java implementation. Check both midpoint calculations for the reported integer-overflow risk and verify that the implementations use the safer calculation consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100