[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.1] block/cow: Avoid use of uninitialized c
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.1] block/cow: Avoid use of uninitialized cow_bs in error path |
Date: |
Mon, 30 Jun 2014 12:07:28 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 06/30/2014 12:03 PM, Peter Maydell wrote:
> Commit 25814e8987 introduced an error-exit code path which does
> a "goto exit" before the cow_bs variable is initialized, meaning
> we would call bdrv_unref() on an uninitialized variable and
> likely segfault. Fix this by moving the NULL-initialization
> to the top of the function and making the exit code path handle
> the case where it is NULL.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> block/cow.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
(and I obviously missed catching this on my first review of the patch)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature