mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemu: agent: clear stale pointer in qemuAgentGetDisks
CVE-2026-77158
In case of hitting the cleanup label, the disks array
was freed but the pointer was not cleared, leading
to a possible double free.
Fixes: 0cb2d9f05d (v6.10.0-9-g0cb2d9f05d)
Closes: https://gitlab.com/libvirt/libvirt/-/work_items/910
Reported-by: David Korczynski (Ada Logics)
Found-by: Claude
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
1 parent
b8eb060035
commit
9d3adf8db6
1 file changed
+1
-1
@@ -2562,7 +2562,7 @@ int qemuAgentGetDisks(qemuAgent *agent,
|
||||
for (i = 0; i < ndata; i++) {
|
||||
qemuAgentDiskInfoFree((*disks)[i]);
|
||||
}
|
||||
g_free(*disks);
|
||||
g_clear_pointer(disks, g_free);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user