qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] bdrv_img_create: Fix segfault


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] bdrv_img_create: Fix segfault
Date: Wed, 1 Jun 2011 23:34:52 +0100

On Wed, Jun 1, 2011 at 1:05 PM, Kevin Wolf <address@hidden> wrote:
> Block drivers that don't support creating images don't have a size option. 
> Fail
> gracefully instead of segfaulting when trying to access the option's value.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

A command-line to reproduce the crash would be nice.

I noticed this line above your fix:
set_option_parameter_int(param, BLOCK_OPT_SIZE, img_size);

If I follow correctly there should be an "Unknown option 'size'" error
message before set_option_parameter_int() returns -1 (which we ignore)
and then crash.

Perhaps we should just catch the error when set_option_parameter_int() fails?

Stefan



reply via email to

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