Re: [Qemu-devel] [PATCH v2 2/2] qcow2: Fix fail path in realloc_refcount_block()

2014-03-18 Thread Kevin Wolf
Am 17.03.2014 um 23:04 hat Max Reitz geschrieben: > If qcow2_alloc_clusters() fails, new_offset and ret will both be > negative after the fail label, thus passing the first if condition and > subsequently resulting in a call of qcow2_free_clusters() with an > invalid (negative) offset parameter. Fi

Re: [Qemu-devel] [PATCH v2 2/2] qcow2: Fix fail path in realloc_refcount_block()

2014-03-17 Thread Laszlo Ersek
On 03/17/14 23:04, Max Reitz wrote: > If qcow2_alloc_clusters() fails, new_offset and ret will both be > negative after the fail label, thus passing the first if condition and > subsequently resulting in a call of qcow2_free_clusters() with an > invalid (negative) offset parameter. Fix this by intr

[Qemu-devel] [PATCH v2 2/2] qcow2: Fix fail path in realloc_refcount_block()

2014-03-17 Thread Max Reitz
If qcow2_alloc_clusters() fails, new_offset and ret will both be negative after the fail label, thus passing the first if condition and subsequently resulting in a call of qcow2_free_clusters() with an invalid (negative) offset parameter. Fix this by introducing a new label "fail_free_cluster" whic