diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-03-24 18:36:26 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-03-26 14:44:32 +0100 |
commit | 66c8672d242e9a494216237648b7787649c2c970 (patch) | |
tree | 637753bcc6ef4f1d1eef69ee39b596edd809aa86 /block | |
parent | 01e38186ecb1fc6275720c5425332eed280ea93d (diff) |
block/mirror: fix use after free of local_err
local_err is used again in mirror_exit_common() after
bdrv_set_backing_hd(), so we must zero it. Otherwise try to set
non-NULL local_err will crash.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200324153630.11882-3-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/mirror.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/mirror.c b/block/mirror.c index 447051dbc6..6203e5946e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -678,6 +678,7 @@ static int mirror_exit_common(Job *job) bdrv_set_backing_hd(target_bs, backing, &local_err); if (local_err) { error_report_err(local_err); + local_err = NULL; ret = -EPERM; } } |