]> git.proxmox.com Git - mirror_qemu.git/commit
qemu-img: assert block_job_get() does not return NULL in img_commit()
authorLiam Merwick <Liam.Merwick@oracle.com>
Mon, 5 Nov 2018 21:38:37 +0000 (21:38 +0000)
committerMax Reitz <mreitz@redhat.com>
Mon, 12 Nov 2018 16:49:21 +0000 (17:49 +0100)
commit2e2db260093d44130a8a2974aed3cc8149c0a08d
treee3bfe57726175510a239a1cc4a696eb18df30d3f
parent602414d1232723d92836babe8d7014b57b93e4d9
qemu-img: assert block_job_get() does not return NULL in img_commit()

Although the function block_job_get() can return NULL, it would be a
serious bug if it did so (because the job yields before executing anything
(if it started successfully); but otherwise, commit_active_start() would
have returned an error).  However, as a precaution, before dereferencing
the 'job' pointer in img_commit() assert it is not NULL.

Signed-off-by: Liam Merwick <Liam.Merwick@oracle.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1541453919-25973-4-git-send-email-Liam.Merwick@oracle.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
qemu-img.c