SDL2 UI sends a NULL to sdl_grab_start if fullscreen, which crashes

Bug #1326533 reported by Brandon Schaefer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

in ui/sdl2.c:

    if (full_screen) {
        gui_fullscreen = 1;
        sdl_grab_start(0);
    }

Is sent, but no null checks are made in sdl_grab_start (its assumed to be an allocated pointer). So a crash happens if you start qemu -full-screen.

It should at lease send the first [0] of the newly allocated sdl2_console through.

Quickly looking around should look something like:

    if (full_screen) {
        gui_fullscreen = 1;
        sdl_grab_start(&sdl2_console[0]);
    }

Or possibly put into the loop where the sdl2_console is created

description: updated
Revision history for this message
Thomas Huth (th-huth) wrote :

The NULL pointer check has been added here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=f2335791fd0ceb2f9e3

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.