Add some null pointer checks. This is a blind attempt to fix bug 4155.
authorGerald Combs <gerald@wireshark.org>
Fri, 6 Nov 2009 18:08:59 +0000 (18:08 -0000)
committerGerald Combs <gerald@wireshark.org>
Fri, 6 Nov 2009 18:08:59 +0000 (18:08 -0000)
svn path=/trunk/; revision=30846

gtk/capture_if_dlg.c

index 6443640f3a56b6dad02f078caa5c02de7aab74ce..6c77055ba4713ca01027d88e9411840729fe19e5 100644 (file)
@@ -342,22 +342,26 @@ GtkWidget * capture_get_if_icon(const if_info_t* if_info _U_)
    *
    * by making some NDIS request.
    */
-  if ( strstr(if_info->description,"generic dialup") != NULL ||
-       strstr(if_info->description,"PPP/SLIP") != NULL) {
+  if ( if_info->description && ( strstr(if_info->description,"generic dialup") != NULL ||
+       strstr(if_info->description,"PPP/SLIP") != NULL ) ) {
     return xpm_to_widget(modem_16_xpm);
   }
 
-  if ( strstr(if_info->description,"Wireless") != NULL || strstr(if_info->description,"802.11") != NULL ||
-       strstr(if_info->description,"AirPcap") != NULL || strstr(if_info->name,"airpcap") != NULL) {
+  if ( if_info->description && ( strstr(if_info->description,"Wireless") != NULL ||
+       strstr(if_info->description,"802.11") != NULL || strstr(if_info->description,"AirPcap") != NULL ) ) {
+    return xpm_to_widget(network_wireless_16_xpm);
+  }
+
+  if ( strstr(if_info->name,"airpcap") != NULL ) {
     return xpm_to_widget(network_wireless_16_xpm);
   }
 
   /* TODO: find a better icon! */
-  if ( strstr(if_info->description,"VMware") != NULL) {
+  if ( if_info->description && strstr(if_info->description,"VMware") != NULL ) {
     return xpm_to_widget(network_virtual_16_xpm);
   }
 
-  if ( strstr(if_info->description,"Bluetooth") != NULL) {
+  if ( if_info->description && strstr(if_info->description,"Bluetooth") != NULL ) {
     return xpm_to_widget(network_bluetooth_16_xpm);
   }
 #elif defined(__APPLE__)