-
Notifications
You must be signed in to change notification settings - Fork 19
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 when ending a chat line with ¬ #73
Comments
This is fixed but that code still lives on. I think it is needed to divide lines up for the chat tab. I also don't really like the stuff that goes all the way back out to GUI code to make chat lines, but actually thats how the original did it too: Avara/src/game/CPlayerManager.cpp Lines 609 to 680 in 30ded35
additionally, i was gonna say something about making it match by renaming the function to FlushMessage but then i realized that I ALSO ignored an old function RosterKeyPress when i was making special characters show up in the roster chat! so i have no room to talk! And i'm closing this! |
When outside of a game, you can type "¬" with impunity, unless it is the last character in the line when you press Enter.
The source of the issue seems to lie in
std::string CPlayerManagerImpl::GetChatLine()
, which examines the line buffer to grab the most recent line of chat by finding the last "¬" character (the assumption being that it marked the end of the line prior to the one we want). A substring is returned containing everything following that point. Unfortunately, when the last character in the buffer just happens to be a "¬", an invalid index is submitted tosubstr
, hence the crash.Checking for this specific condition is unfortunately not sufficient, because another issue would remain: typing "asdf ¬ qwerty" followed by Enter would result in "qwerty" being returned, rather than the full string.
Here's the backtrace:
The text was updated successfully, but these errors were encountered: