Fix bad checking of values in setStartupBoost()#8
Merged
Alayan-stk-2 merged 1 commit intoAlayan-stk-2:BalanceSTK2from Sep 29, 2025
Merged
Conversation
Owner
|
Thank you for the PR, I didn't see it earlier. The code seems straightforward enough, I'll check it when I have a bit of time for testing. |
e6ced1b
into
Alayan-stk-2:BalanceSTK2
20 of 21 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This issue was caused by an oversight in the preconditions of f90c452.
The consequence was that, in online races, if a player didn't press anything during the start sequence, the
boost_levelvalue of 1, indicating a normal start with no penalties and no boosts, would get sent from the server to the clients. This would then be processed byKart::setStartupBoost(uint8_t boost_level), which in fact had a wrong assert that treated a boost level of 1 as a valid value, when it instead resulted on an out-of-bounds memory access to the startup boost vectors when fed into the index formula, crashing every single client.Fixed by adding an alternate scenario for when the boost level is < 2.
Agreement