]> xenbits.xensource.com Git - libvirt.git/commit
interface: fix udev_device_get_sysattr_value return value check
authorDmitry Frolov <frolov@swemel.ru>
Tue, 12 Sep 2023 12:56:47 +0000 (15:56 +0300)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 25 Sep 2023 12:47:08 +0000 (14:47 +0200)
commit2ca94317ac642a70921947150ced8acc674ccdc8
treefd1423bf6963f5cc3336055bd63539677dce38ee
parent9783b2b3e5a5a7ae5c40cd02e4e8a694b1dbd137
interface: fix udev_device_get_sysattr_value return value check

Reviewing the code I found that return value of function
udev_device_get_sysattr_value() is dereferenced without a check.
udev_device_get_sysattr_value() may return NULL by number of reasons.

v2: VIR_DEBUG added, replaced STREQ(NULLSTR()) with STREQ_NULLABLE()
v3: More checks added, to skip earlier. More verbose VIR_DEBUG.

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/interface/interface_backend_udev.c