Fix empty roomnames potentially crashing the game#1265
Merged
flibitijibibo merged 2 commits intoTerryCavanagh:masterfrom Feb 16, 2026
Merged
Fix empty roomnames potentially crashing the game#1265flibitijibibo merged 2 commits intoTerryCavanagh:masterfrom
flibitijibibo merged 2 commits intoTerryCavanagh:masterfrom
Conversation
TinyXML2 seems to sometimes return NULL when an element has either no text or whitespace, instead of returning an empty string. Why it does this, I'm not sure, but I have recently learned from Dav999 that it will crash the game. Great.
There's another crash, which is indexing out of bounds if there's not enough text. This adds simple bounds checks for them.
flibitijibibo
approved these changes
Feb 16, 2026
Collaborator
Daaaav
added a commit
to Daaaav/Ved
that referenced
this pull request
Feb 17, 2026
Ved now puts the special roomnames from the XML into data structures, and writes those data structures back to XML. As Ally fixed in TerryCavanagh/VVVVVV#1265, it turned out the game couldn't deal with empty (or whitespace-only) roomnames, since TinyXML's element GetText() method returns NULL if it doesn't find a text node (or only stripped out whitespace). Luckily this is easy for Ved to workaround by just using a <![CDATA[]]> instead of raw text in that case, since that also counts as a text node (it's basically just an escape). The bug just got fixed in the VVVVVV repo, but it can't hurt to include the CDATA anyway (it's just two lines of code and it parses the same) [pre11]
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.
Changes:
TinyXML2 seems to sometimes return NULL when an element has either no text or whitespace, instead of returning an empty string. Why it does this, I'm not sure, but I have recently learned from @Daaaav that it will crash the game. Great.
Should probably be merged in a 2.4 branch too.
Legal Stuff:
By submitting this pull request, I confirm that...
CONTRIBUTORSfile and the "GitHub Friends"section of the credits for all of said releases, but will NOT be compensated
for these changes unless there is a prior written agreement