Wireshark mailing list archives

Re: Seg Fault - Creating new wiretap type


From: Hadriel Kaplan <HKaplan () acmepacket com>
Date: Sat, 23 Oct 2010 11:22:32 -0400


You don't have the following at the beginning of your .c file:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

I assume without that, HAVE_LIBZ (and a bunch of other stuff) isn't defined when your .c file includes the remaining 
header files, and it's doomed.

-hadriel

On Oct 22, 2010, at 7:50 PM, Alex Lindberg wrote:

I have uploaded a patch file and example C and H files to bugzilla that demonstrate the SEG Fault.  I sure that I have 
overlooked something simple.

Bug 5333.

Thanks as always.
Alex Lindberg

--- On Fri, 10/22/10, Stephen Fisher <steve () stephen-fisher com<mailto:steve () stephen-fisher com>> wrote:

From: Stephen Fisher <steve () stephen-fisher com<mailto:steve () stephen-fisher com>>
Subject: Re: [Wireshark-dev] Seg Fault - Creating new wiretap type
To: "Developer support list for Wireshark" <wireshark-dev () wireshark org<mailto:wireshark-dev () wireshark org>>
Date: Friday, October 22, 2010, 12:34 PM

On Thu, Oct 21, 2010 at 02:42:34PM -0700, Alex Lindberg wrote:

That was my thought, however I used a debugger and printf statements
to watch the file handle passed to the wiretap routines.  The file was
the same in all cases.  This has me stumped. It seems that my string
buffer is not allowed during the file_gets routing.  Perhaps making
the buffer a const for the procedure, but that is not necessary in
other modules.

It is strange.  file_gets() is typically #define as gzgets() when
compiled with zlib.  The return of gzgets() is the same as fgets()
(which is used when zlib isn't present) - a char *.  I noticed that
you're using an unsigned char (guchar), but a test program I made
outside of Wireshark works fine with that too.  Want to send a patch of
your changes so we can try it also?

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org<x-msg://1522/mc/compose?to=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<x-msg://1522/mc/compose?to=wireshark-dev-request () 
wireshark org>?subject=unsubscribe


<ATT00001..c>

___________________________________________________________________________
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: