[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] HMP: Initialize err before using
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH] HMP: Initialize err before using |
Date: |
Wed, 7 Mar 2018 09:52:19 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
* Zhangjixiang (address@hidden) wrote:
> When bdrv_snapshot_delete return fail, the errp will not be
> assigned a valid value in error_propagate as errp didn't be
> initialized in hmp_delvm, then error_reportf_err will use an
> uninitialized value(call by hmp_delvm), and qemu crash.
>
> Signed-off-by: zhangjixiang <address@hidden>
Thanks; it's already noted to go in my next HMP pull.
(And this time the mail is the right format, thanks).
Dave
> ---
> hmp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hmp.c b/hmp.c
> index 7870d6a300..4a4da004e9 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1340,7 +1340,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
> void hmp_delvm(Monitor *mon, const QDict *qdict)
> {
> BlockDriverState *bs;
> - Error *err;
> + Error *err = NULL;
> const char *name = qdict_get_str(qdict, "name");
> if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) {
> --
> 2.11.0
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK