mirror of https://gitee.com/openkylin/libvirt.git
1f96775866
Coverity complains that the comparison: if (nfds && nfds > ((int)!!sock_path + (int)!!sock_path_ro)) could mean 'sock_path' is NULL. Later in virNetSocketNewListenUNIX there's a direct dereference of path in the error path: if (path[0] != '@') A bit of sleuthing proves that upon entry to daemonSetupNetworking there is no way for 'sock_path' to be NULL since daemonUnixSocketPaths will set up 'sock_file' (although it may not set up 'sock_file_ro') in all 3 paths. Adjusted code to add ATTRIBUTE_NONNULL(3) on incoming path parameter and then fixup the comparison of nfds to be a comparison against 2 or 1 depending on whether sock_path_ro is NULL or not. |
||
---|---|---|
.. | ||
Makefile.am | ||
THREADS.txt | ||
libvirtd-config.c | ||
libvirtd-config.h | ||
libvirtd.aug | ||
libvirtd.c | ||
libvirtd.conf | ||
libvirtd.h | ||
libvirtd.init.in | ||
libvirtd.logrotate.in | ||
libvirtd.lxc.logrotate.in | ||
libvirtd.pod.in | ||
libvirtd.policy.in | ||
libvirtd.qemu.logrotate.in | ||
libvirtd.sasl | ||
libvirtd.service.in | ||
libvirtd.socket.in | ||
libvirtd.sysconf | ||
libvirtd.sysctl | ||
libvirtd.uml.logrotate.in | ||
libvirtd.upstart | ||
remote.c | ||
remote.h | ||
stream.c | ||
stream.h | ||
test_libvirtd.aug.in |