ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 30846: /trunk/gtk/ /trunk/gtk/: capt

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 6 Nov 2009 23:07:25 -0800

On Nov 6, 2009, at 10:09 AM, gerald@xxxxxxxxxxxxx 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.