[libvirt] [PATCH] qemu: checkpoint: fix NULL dereference at create time

Cole Robinson posted 1 patch 4 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/425bd547c5348dc28f885a70fed0a94a0c4e028b.1575848405.git.crobinso@redhat.com
src/qemu/qemu_checkpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: checkpoint: fix NULL dereference at create time
Posted by Cole Robinson 4 years, 4 months ago
'cfg' is never initialized here, which causes a crash
later in qemuCheckpointCreateFinalize

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/qemu/qemu_checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index d5af6b99bf..58cf337833 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -468,7 +468,7 @@ qemuCheckpointCreateXML(virDomainPtr domain,
     bool update_current = true;
     bool redefine = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE;
     unsigned int parse_flags = 0;
-    g_autoptr(virQEMUDriverConfig) cfg = NULL;
+    g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     g_autoptr(virCaps) caps = NULL;
     g_autoptr(virDomainCheckpointDef) def = NULL;
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: checkpoint: fix NULL dereference at create time
Posted by Peter Krempa 4 years, 4 months ago
On Sun, Dec 08, 2019 at 18:40:05 -0500, Cole Robinson wrote:
> 'cfg' is never initialized here, which causes a crash
> later in qemuCheckpointCreateFinalize
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/qemu/qemu_checkpoint.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>

I have the same patch in my not-yet-posted series which integrates
snapshot handling and checkpoints.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list