- virtlockd, virtlogd: Fix exec-restart 6b8e9613-avoid-use-after-free.patch, eab7ae6b-fix-array-access.patch, c363f03e-virnetdaemon-intro-virNetDaemonQuitExecRestart.patch, ccc6dd8f-fix-exec-restart.patch bsc#1183411 OBS-URL: https://build.opensuse.org/request/show/878655 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=883
28 lines
932 B
Diff
28 lines
932 B
Diff
commit 6b8e961399549c5c8fdf06875e5981c564829ad6
|
|
Author: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Fri Mar 12 10:12:51 2021 +0100
|
|
|
|
virLockSpacePreExecRestart: Avoid use-after-free
|
|
|
|
Recent refactor marked 'object' which is returned from the function as
|
|
autofree but forgot to use g_steal_pointer in the return statement to
|
|
prevent freeing it.
|
|
|
|
Fixes: 9a1651f64d7
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
|
Index: libvirt-7.1.0/src/util/virlockspace.c
|
|
===================================================================
|
|
--- libvirt-7.1.0.orig/src/util/virlockspace.c
|
|
+++ libvirt-7.1.0/src/util/virlockspace.c
|
|
@@ -472,7 +472,7 @@ virJSONValuePtr virLockSpacePreExecResta
|
|
goto error;
|
|
|
|
virMutexUnlock(&lockspace->lock);
|
|
- return object;
|
|
+ return g_steal_pointer(&object);
|
|
|
|
error:
|
|
virMutexUnlock(&lockspace->lock);
|