mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
virsh: prevent potential NULL dereference
virXPathString() can return NULL so we need to use STRNEQ_NULLABLE here Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Dmitry Fedin <d.fedin@fobos-nt.ru> Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
committed by
Michal Privoznik
parent
6230eed02c
commit
9ccd9676a8
@@ -891,7 +891,7 @@ virshDomainConsoleCompleter(vshControl *ctl,
|
||||
ctxt->node = parallels[i - nserials];
|
||||
|
||||
type = virXPathString("string(./@type)", ctxt);
|
||||
if (STRNEQ(type, "pty"))
|
||||
if (STRNEQ_NULLABLE(type, "pty"))
|
||||
continue;
|
||||
|
||||
tmp[offset++] = virXPathString("string(./alias/@name)", ctxt);
|
||||
|
||||
Reference in New Issue
Block a user