Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libceph: fix overflow check in crush_decode()
The existing overflow check (n > ULONG_MAX / b) didn't work, because n = ULONG_MAX / b would both bypass the check and still overflow the allocation size a + n * b. The correct check should be (n > (ULONG_MAX - a) / b). Signed-off-by: Xi Wang <[email protected]> Signed-off-by: Sage Weil <[email protected]>
- Loading branch information