Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.

FECUI_HandleEmuCommands was not re-entrant [fixes RANes crash on load savestate] #28

Merged
merged 1 commit into from
Dec 13, 2017

Conversation

Jamiras
Copy link
Member

@Jamiras Jamiras commented Nov 19, 2017

If any of the function calls invoked from FCEUI_HandleEmuCommands resulted in FCEUI_HandlEmuCommands being called again, the loop counter i would be updated by the nested call to NUM_EMU_CMDS, making the assignment at the end of the loop write past the end of the array. This results in memory corruption, and depending on what lied beyond the end of the array, could lead to crashing.

I've made i a local variable so a recursive call won't muck with it. The external function using i was modified to look at execcmd instead.

@Jamiras Jamiras changed the title FECUI_HandleEmuCommands was not re-entrant FECUI_HandleEmuCommands was not re-entrant [fixes RANes crash on load savestate] Dec 11, 2017
@GameDragon2k GameDragon2k merged commit 1318b31 into RetroAchievements:master Dec 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants