You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function Clay__IntToString(int integer) could overflow for INT_MIN due to signed integer negation (integer = -integer), possibly resulting in undefined behavior.
Hello 🙂
his seems possible but I'm not sure that the implications are so severe - this is an internal function used for the debug tools, so it appears to me that the worst case is that the debug tools display the wrong value in the interface?
I did not check in detail where this function is used, but in the current context you're right, it seems just fine. That said, I wanted to point out at a potential problem that may arise from incorrect usage later 🙂.
Arithmetic overflow for signed integers is undefined behavior in the C standard. Depending on the compiler and platform, this could lead to more severe consequences than just displaying the wrong value in the interface, so it might be worth fixing to avoid relying on implementation-specific behavior.
The function
Clay__IntToString(int integer)
could overflow for INT_MIN due to signed integer negation (integer = -integer), possibly resulting in undefined behavior.clay/clay.h
Lines 2281 to 2283 in a48d406
The text was updated successfully, but these errors were encountered: