]> Git Repo - qemu.git/commit
qemu_opts_parse(): always check return value
authorLaszlo Ersek <[email protected]>
Thu, 28 Nov 2013 17:12:59 +0000 (18:12 +0100)
committerAnthony Liguori <[email protected]>
Mon, 16 Dec 2013 23:33:48 +0000 (15:33 -0800)
commitf46e720a82ccdf1a521cf459448f3f96ed895d43
tree7d73a6f642670a82d1d627f07153c577ff71981c
parentb91f93243bbe36dc436a64a662a9bbfb2362534a
qemu_opts_parse(): always check return value

qemu_opts_parse() can always return NULL, even if the QemuOptsList.desc in
question would be trivial to satisfy (eg. because it's empty). For
example:

qemu_opts_parse()
  opts_parse()
    qemu_opts_create()
      id_wellformed()

In practice:

  $ .../qemu-system-x86_64 -acpitable id=3
  qemu-system-x86_64: -acpitable id=3: Parameter 'id' expects an identifier
  **
  ERROR:vl.c:3491:main: assertion failed: (opts != NULL)
  Aborted (core dumped)

  $ .../qemu-system-x86_64 -smbios id=3
  qemu-system-x86_64: -smbios id=3: Parameter 'id' expects an identifier
  Segmentation fault (core dumped)

I checked all qemu_opts_parse() invocations (and all drive_def()
invocations too, because it blindly forwards the former's retval). Only
the two above examples look problematic.

Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-id: 1385658779[email protected]
Signed-off-by: Anthony Liguori <[email protected]>
vl.c
This page took 0.024007 seconds and 4 git commands to generate.