Closed jpdoyle closed 2 years ago
Thanks for your feedback.
I would rather prevent the overflow by changing line 122 to INT_MAX
. Do you agree? If so please send a PR so that I can merge your fix.
Would you prefer to not have ubsan
enabled? It seems like a good thing to include, especially since print_time
will have undefined behavior for large numbers on any platform where int
is 64-bit.
I can make a PR with both ubsan
and the UINT_MAX
-> INT_MAX
change
Checking against INT_MAX
should prevent undefined behaviours but I will give a deeper look and make some test.
I will merge #18 for now.
I added undefined behavior sanitization to
snore
in a small patch: https://github.com/jpdoyle/snore/tree/ubsan-overflowWith that patch, I can trigger signed integer overflow by doing: