Skip to contentSkip to conversation

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

Qemu-devel Brandon Schaefer 1 participant 2 messages Jun 4, 2014 – Jul 6, 2017

lore
Share & tools
lore
#0 lore raw

Public bug reported:

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

** Affects: qemu
Importance: Undecided
Status: New

** Description changed:

in ui/sdl2.c:

- if (full_screen) {
- gui_fullscreen = 1;
- sdl_grab_start(0);
- }
+     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]);
- }
+     if (full_screen) {
+         gui_fullscreen = 1;
+         sdl_grab_start(&sdl2_console[0]);
+     }
+
+ Or possibly put into the loop where the sdl2_console is created

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1326533

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

Status in QEMU:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1326533/+subscriptions
#1 lore raw

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

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1326533

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

Status in QEMU:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1326533/+subscriptions