Wireshark-dev: Re: [Wireshark-dev] Crashes while Airpcap sniffing
From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Mon, 02 Jan 2012 21:20:10 +0100
Hi,

Can you file a proper bug report on this at bugs.wireshark.org
That way the bug context and patch won't get lost (although it may take a while for it to be picked up, unfortunately).

Thanks,
Jaap

On 2012-01-02 16:26, Gisle Vanem wrote:
There are some places in the ./gtk sources that causes a
crash while sniffing on a AirPcap adapter. I don't know why;
maybe most code assumes the captured frames contain network
layer packets. Since my Airpcap (\\.\airpcap00 on Win-XP) only gives
me IEEE 802.11 radio frames, I can only speculate.

I.e. here is one situation in gtk/stats_tree_stat.c:

void gtk_stats_tree_cb(GtkAction *action, gpointer user_data _U_)
{
...
cfg = stats_tree_get_cfg_by_abbr(abbr);
if(cfg){
 tap_param_dlg_cb(action, cfg->pr->stat_dlg);

Pressing the menu "Statistics | Sametime | Messages" while sniffing
on AirPcap ... kaboom! Since "cfg != NULL", but "cgf->pr == NULL".
What's the story here?

A simple patch:

--- SVN-Latest\gtk\stats_tree_stat.c    Mon Oct 31 11:17:42 2011
+++ gtk\stats_tree_stat.c       Mon Jan 02 16:11:12 2012
@@ -389,7 +389,7 @@
               abbr = g_strdup_printf("%s",action_name);
       }
       cfg = stats_tree_get_cfg_by_abbr(abbr);
-       if(cfg){
+       if(cfg && cfg->pr){
               tap_param_dlg_cb(action, cfg->pr->stat_dlg);
       }else{
        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,

But it would be nicer if that menu would be greyed out. But I have no
idea on how to do it myself.

There are also this situation (which I can get back to): when getting
an unexpected "Information Element ID", the function
capture_if_details_802_11_bssid_list() tries to hex-dump a buffer and
reading beyond the buffer returned by wpcap_packet_request(). Kaboom
again.

--gv