NULL passed to strcmp in Wayland_ShowMessageBox

This commit is contained in:
meyraud705 authored and Ryan C. Gordon committed 2021-04-04 08:15:33 -04:00
1 parent 573c5a5bac
commit 413a2306bc
1 file changed
+2
@@ -150,11 +150,13 @@ Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
/* Check which button got pressed */ /* Check which button got pressed */
for (i = 0; i < messageboxdata->numbuttons; i += 1) { for (i = 0; i < messageboxdata->numbuttons; i += 1) {
if (messageboxdata->buttons[i].text != NULL) {
if (SDL_strcmp(output, messageboxdata->buttons[i].text) == 0) { if (SDL_strcmp(output, messageboxdata->buttons[i].text) == 0) {
*buttonid = i; *buttonid = i;
break; break;
} }
} }
}
end: end:
SDL_free(command); SDL_free(command);