Wireshark mailing list archives
Re: [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capture_if_dlg.c
From: Gerald Combs <gerald () wireshark org>
Date: Sat, 07 Nov 2009 10:38:50 -0800
Guy Harris wrote:
On Nov 6, 2009, at 10:09 AM, gerald () wireshark org wrote:http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=30846 User: gerald Date: 2009/11/06 10:09 AM Log: Add some null pointer checks. This is a blind attempt to fix bug 4155.Note that pcap_findalldevs() is not specified as guaranteeing that all interfaces have a non-null description field. A quick look at the WinPcap 4.1.1 code doesn't seem to show any way for any interfaces to have a null description field on Windows, but perhaps I'm missing something. In any case, the checks for a null pointer probably still belong there, just in case, in the future, pcap_findalldevs() can return an interface with a null description field. However, if the description field is null, no () will be printed. If it points to a null *string*, () will be printed - but you won't get a null-pointer dereference in that case.
In capture_interface_list we don't set the interface description if we get an empty string from dumpcap: if (strlen(if_parts[1]) > 0) if_info->description = g_strdup(if_parts[1]); This is apparently how we ended up with null description pointers in capture_get_if_icon. Should we take out the if statement and set the description no matter what? ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Re: [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capture_if_dlg.c Guy Harris (Nov 06)
- Re: [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capture_if_dlg.c Gerald Combs (Nov 07)
- Re: [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capture_if_dlg.c Guy Harris (Nov 07)
- Re: [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capture_if_dlg.c Gerald Combs (Nov 07)