]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virshFindDisk: fix NULL-dereference of xmlCopyNode() result
authorAnastasia Belova <abelova@astralinux.ru>
Wed, 16 Jul 2025 13:42:14 +0000 (16:42 +0300)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 17 Jul 2025 10:54:17 +0000 (12:54 +0200)
commit1eaaec533abbad52a40c282f1f1d009248c08e3d
treef3b6cd35135267c688f365cb656ae84a0db76905
parentcad407c8620e117b2826c7e662b9f04a8142641f
virshFindDisk: fix NULL-dereference of xmlCopyNode() result

xmlCopyNode() may return NULL. Add a check and log an error
in this case.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Fixes: 22766a1a53 ("virshFindDisk: Sanitize use of 'tmp' variable")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh-domain.c