From: Kevin Wolf <address@hidden>
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 <address@hidden>
---
block/qcow2.c | 7 ++++---
tests/qemu-iotests/080 | 7 +++++++
tests/qemu-iotests/080.out | 4 ++++
3 files changed, 15 insertions(+), 3 deletions(-)