Tomash667 / carpg

Combination of action rpg with roguelike.
https://carpg.pl
MIT License
16 stars 15 forks source link

Console causing game crash when extremely long integer is supplied to a command #425

Closed BottledByte closed 4 years ago

BottledByte commented 4 years ago

Thanks @Lemiczek for first noticing this.

While typing into developer console a command which accepts number, when numerical string reaches certain length and the command gets executed, it results in program's crash. When I build the game with debug configuration, I received an error from Visual C++ Runtime that debug assertion failed and it stated that source of that failed assert is following:

scree

It is obviously not a part of game or its engine. I tried to track this issue, but I do not have debugging toolset. I tracked it into Tokenizer in carpglib, only to loose it there. Based on my observation, it is not caused by Tokenizer's AssertXXX(), which, as I assume, should prevent this thing to go so deep into the Visual C++ Runtime.

Lemiczek commented 4 years ago

The extremely long integer is 4294967296 (2^32) or above. After this number, the game crashes instead of setting gold back to 0 as it does after 2147483647 (2^31 -1).

Tomash667 commented 4 years ago

Fixed in 0.14.