There are no checks, virDomainChrSourceDefNew can return 0
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 1 patch 1 replyIn review
Patches in v1 No applies recorded yet
The patch the cover letter announces is not in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [sdl-qemu] [PATCH 0/1] There are no checks, virDomainChrSourceDefNew can return 0
There are no checks, virDomainChrSourceDefNew can return 0.
Return value of a function 'virDomainChrSourceDefNew'
is dereferenced at qemu_hotplug.c without checking for NULL,
but it is usually checked for this function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes 1f85f0967b ("ci: jobs.sh: Add back '--no-suite syntax-check --print-errorlogs'")
Signed-off-by Sergey Mironov <[email protected]>
---src/qemu/qemu_hotplug.c | 2 ++
1 file changed, 2 insertions(+)
src/qemu/qemu_hotplug.c +2 -1
@@ -3207,6 +3207,8 @@ qemuDomainAttachFSDevice(virQEMUDriver *driver,qemuAssignDeviceFSAlias (vm->def, fs); chardev =virDomainChrSourceDefNew (priv->driver->xmlopt); +if (chardev ==NULL ) + goto cleanup; chardev->type =VIR_DOMAIN_CHR_TYPE_UNIX ; chardev->data.nix.path =qemuDomainGetVHostUserFSSocketPath (priv, fs); --
2.31.1