qemu-img: Fix crash in amend invocation
authorMax Reitz <mreitz@redhat.com>
Thu, 20 Aug 2015 23:00:38 +0000 (16:00 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sat, 17 Oct 2015 23:18:12 +0000 (18:18 -0500)
commit9a20ccaecd45f21ac4766ae6634aaa5499ddc772
tree4c89f51ca61392b48f2529e3c46b271f7e62141f
parentd9af73191cc4a1f23ca8149ca2d5f71f74f5329d
qemu-img: Fix crash in amend invocation

Example:
$ ./qemu-img create -f qcow2 /tmp/t.qcow2 64M
$ ./qemu-img amend -f qcow2 -o backing_file=/tmp/t.qcow2, -o help \
    /tmp/t.qcow2

This should not crash. This actually is tested by iotest 082, but not
caught due to the segmentation fault being silent (which is something
that needs to be fixed, too).

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit e814dffcc9810ed77fe99081be9751b620a894c4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-img.c