summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/runonphone/serenum_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp
index db6375e..f65497e 100644
--- a/tools/runonphone/serenum_unix.cpp
+++ b/tools/runonphone/serenum_unix.cpp
@@ -82,7 +82,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel)
for (struct usb_bus *bus = usb_get_busses(); bus; bus = bus->next) {
for (struct usb_device *device = bus->devices; device; device = device->next) {
- for (int n = 0; n < device->descriptor.bNumConfigurations; ++n) {
+ for (int n = 0; n < device->descriptor.bNumConfigurations && device->config; ++n) {
struct usb_config_descriptor &usbConfig =device->config[n];
QList<int> usableInterfaces;
for (int m = 0; m < usbConfig.bNumInterfaces; ++m) {