]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: Fix NULL dereference in qcow2_open() error path (CVE-2014-0146)
authorKevin Wolf <kwolf@redhat.com>
Wed, 26 Mar 2014 12:06:04 +0000 (13:06 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:18:14 +0000 (16:18 -0500)
commitc2c52728f5719a4534f52fd2f0c6f3d04e230bdf
tree5f96ebc3229d93c2ec98e362440a1c668be59b68
parent759d38652ae6bbe1253b921c13c43d2c6c25b8d5
qcow2: Fix NULL dereference in qcow2_open() error path (CVE-2014-0146)

The qcow2 code assumes that s->snapshots is non-NULL if s->nb_snapshots
!= 0. By having the initialisation of both fields separated in
qcow2_open(), any error occuring in between would cause the error path
to dereference NULL in qcow2_free_snapshots() if the image had any
snapshots.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 11b128f4062dd7f89b14abc8877ff20d41b28be9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out