qemu-devel
[Top][All Lists]
Advanced

[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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH for-2.1] block/cow: Avoid use of uninitialized cow_bs in error path
Date: Tue, 1 Jul 2014 09:22:57 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 30, 2014 at 07:03:37PM +0100, 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(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

Attachment: pgpQV9K8kjLbO.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]