]> xenbits.xensource.com Git - libvirt.git/commit
node_device: avoid null dereference on error
authorEric Blake <eblake@redhat.com>
Wed, 4 May 2011 23:03:52 +0000 (17:03 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 11 May 2011 17:55:16 +0000 (11:55 -0600)
commit98cd17bd18a78996243f712ece5bc00649dc427f
treec102421908a16db07e12d6304a6f56ccf241a264
parent4c6ae9ae36d3d099064cfe28a7cf08012e3191a3
node_device: avoid null dereference on error

If we plow on after udev_device_get_syspath fails, we will hit a NULL
dereference.  Clang found one due to strdup later in udevSetParent,
but in fact we hit a NULL dereference sooner because of the use of
STREQ within virNodeDeviceFindBySysfsPath.

* src/conf/node_device_conf.h (virNodeDeviceFindBySysfsPath): Mark
path argument non-null.
* src/node_device/node_device_udev.c (udevSetParent): Avoid null
dereference.
src/conf/node_device_conf.h
src/node_device/node_device_udev.c