Re: [Qemu-devel] [PATCH 1/4] qcow2: Move reading nb_snapshots in qcow2_open

2013-11-19 Thread Eric Blake
On 11/17/2013 07:18 AM, Max Reitz wrote: Any goto fail between having read nb_snapshots (returning a non-zero value) and allocating s-snapshots (through qcow2_read_snapshots()) results in qcow2_free_snapshots() being called, dereferencing s-snapshots which is still NULL. Fix this by moving

[Qemu-devel] [PATCH 1/4] qcow2: Move reading nb_snapshots in qcow2_open

2013-11-17 Thread Max Reitz
Any goto fail between having read nb_snapshots (returning a non-zero value) and allocating s-snapshots (through qcow2_read_snapshots()) results in qcow2_free_snapshots() being called, dereferencing s-snapshots which is still NULL. Fix this by moving the reading of nb_snapshots right before the