Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash on th095 when score length is less than 3 #11

Merged
merged 1 commit into from Jul 13, 2021

Conversation

Ltfjx
Copy link
Contributor

@Ltfjx Ltfjx commented Jul 8, 2021

If scoreString's length is less than 3, insertPosition will become a negative number, which is not allowed by size_t and will cause std::out_of_range exceptions.

Same problem but has fixed in createFormattedScore()

@TheBakaRem
Copy link
Owner

TheBakaRem commented Jul 13, 2021

…woops, I didn't know that was an issue.
I was told that th095 had a main menu crash two weeks ago, and this is probably what caused it. Didn't catch it either when testing, since my savefile didn't have an empty score (which I think would be the only way for someone to have a score string of less than 3 characters).
I'll have to review the rest of the code to see if I didn't do the same error elsewhere, which is a possibility.

Thanks for the PR and sorry for the delay!

@TheBakaRem TheBakaRem merged commit 24f39e4 into TheBakaRem:master Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants