From eb98ff47405c519f04ab25a0a7c257b3d752d3ab Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 13 Nov 2021 13:05:02 -0600 Subject: [PATCH] testmessage: Fix overread of stack variable --- test/testmessage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testmessage.c b/test/testmessage.c index b10ab703b..a179b7763 100644 --- a/test/testmessage.c +++ b/test/testmessage.c @@ -61,9 +61,9 @@ button_messagebox(void *eventNumber) if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); if (eventNumber) { - SDL_UserEvent event; + SDL_Event event; event.type = (intptr_t)eventNumber; - SDL_PushEvent((SDL_Event*)&event); + SDL_PushEvent(&event); return 1; } else { quit(2); @@ -72,9 +72,9 @@ button_messagebox(void *eventNumber) SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK"); if (eventNumber) { - SDL_UserEvent event; + SDL_Event event; event.type = (intptr_t)eventNumber; - SDL_PushEvent((SDL_Event*)&event); + SDL_PushEvent(&event); } return 0;