Skip to content

fix potential memory leaks and undefined behavior#1317

Merged
Jamiras merged 4 commits into
RetroAchievements:masterfrom
Jamiras:bugfix/sanitize
May 30, 2026
Merged

fix potential memory leaks and undefined behavior#1317
Jamiras merged 4 commits into
RetroAchievements:masterfrom
Jamiras:bugfix/sanitize

Conversation

@Jamiras

@Jamiras Jamiras commented May 22, 2026

Copy link
Copy Markdown
Member

The c isX functions (like isalpha) have undefined behavior for unicode characters. iswX functions are provided, but the default implementation of those is just to check ranges. Since range checks can be constexpr, and I'm likely to forget about the iswX functions, I've added helper functions in ra::util::String for the isX functions. This eliminates the undefined behavior, and potentially encourages some compiler optimization.

Some missing rc_api_destroy function calls were added, which would eliminate memory leaks in some paths.

Ensures an ImageBinding waiting for an image isn't called if the image arrives after the ImageBinding is destroyed.

Fixes a potential issue with the sensitive parameter logging code if the r= parameter is not the first parameter in the query params.

@Jamiras Jamiras added this to the 1.4.3 milestone May 22, 2026
@Jamiras Jamiras merged commit 847583f into RetroAchievements:master May 30, 2026
6 checks passed
@Jamiras Jamiras deleted the bugfix/sanitize branch May 30, 2026 20:48
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.

1 participant