Ethereal-dev: Re: [Ethereal-dev] Access violation in v0.10.6 (reproducible in d ecode_as_dlg.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 28 Aug 2004 03:01:26 -0700
Francisco Alcoba (ML/EEM) wrote:

I'm not familiar with GTK, but it seems to work as expected; however, I'm not
really sure of whether the elements stored can be trusted -i.e. if it stores
pointers to something that may be changed or the actual data-.

"It" meaning "OBJECT_SET_DATA()"? If you set it with the result of "GINT_TO_POINTER()", it'll store the value passed to "GINT_TO_POINTER()" by putting the integer value into a pointer variable (this requires that you be able to cast an integer to a pointer and get the same bits out, which will work on most if not all platforms on which Windows and UN*X work, although there might be some non-Windows, non-UN*X platforms on which it might not work - but I don't know of any that support GLib and GTK+).

I cannot find a way to get the format you use for diffs for patches
-diff -u doesn't work for me-,

Does "diff -c" work?

so I'm attaching a new version of decode_as_dlg.c
and a comparison by an editor with the one in today's tarball.

I used the diff file, and checked in that change (with another change to put the "decode_change_one_dissector()" call inside the "if (portp != NULL)" - otherwise, a random value, i.e. whatever bits happened to be in the "requested_port" variable, gets passed to "decode_change_one_dissector()").