Skip to content

Correct overflow protection#146

Merged
AltraMayor merged 1 commit intoAltraMayor:masterfrom
jowagner:patch-2
Sep 1, 2020
Merged

Correct overflow protection#146
AltraMayor merged 1 commit intoAltraMayor:masterfrom
jowagner:patch-2

Conversation

@jowagner
Copy link
Contributor

@jowagner jowagner commented Sep 1, 2020

sizeof() returns the number of bytes, not bits, and since this is as an unsigned type and the value typically less than 10 the assertion currently does not fail but also fails to detect problems when MAX_N_BLOCK_ORDER is too big as the comparison is with the the very big number resulting from an unsigned overflow, typically 2^32-2.

`sizeof()` returns the number of bytes, not bits, and since this is as an unsigned type and the value typically less than 10 the assertion currently does not fail but also fails to detect problems when `MAX_N_BLOCK_ORDER` is too big as the comparison is with the the very big number resulting from an unsigned overflow, typically 2^32-2.
@AltraMayor AltraMayor merged commit 10cc50f into AltraMayor:master Sep 1, 2020
@AltraMayor AltraMayor added the Bug label Sep 1, 2020
@AltraMayor
Copy link
Owner

Thank you for this pull request. You have truly dug into the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants