On 26.03.2014 13:06, Stefan Hajnoczi wrote:
From: Kevin Wolf <kw...@redhat.com>

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 <kw...@redhat.com>
---
  block/qcow2.c              | 7 ++++---
  tests/qemu-iotests/080     | 7 +++++++
  tests/qemu-iotests/080.out | 4 ++++
  3 files changed, 15 insertions(+), 3 deletions(-)

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to