From: guy Date: Thu, 1 Feb 2007 03:17:20 +0000 (+0000) Subject: From Florent Drouin: don't crash if the open of the USB bus directory X-Git-Tag: libpcap-1.1.0~488 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/62bf880d23e5a88875089936ee8cd2374e690847 From Florent Drouin: don't crash if the open of the USB bus directory fails. --- diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c index 7265a9c1..d1d09271 100644 --- a/pcap-usb-linux.c +++ b/pcap-usb-linux.c @@ -149,6 +149,7 @@ usb_platform_finddevs(pcap_if_t **alldevsp, char *err_str) /* scan profs usb bus directorys */ dir = opendir(USB_BUS_DIR); + if (!dir) return 0; while ((ret == 0) && ((data = readdir(dir)) != 0)) { int n; char* name = data->d_name;