Skip to content

(code might give the impression of possible) integer overflows in binary search #71

Open
@glycerine

Description

@glycerine

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions