Ethereal-dev: Re: [Ethereal-dev] FW: {* -BIG- *} [Ethereal-users] Clicking on o ur SIP protoco

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: Tue, 13 Apr 2004 11:01:27 -0700
On Tue, Apr 13, 2004 at 01:30:57PM +0200, Anders Broman (AL/EAB) wrote:
> I can open that packet ok with a build from todays tarball, 0.10.3
> crashes, the problem seems to be in the 1.61 verson of packet.sip.c :
> 
> dfilter_sip_request_line(tvbuff_t *tvb, proto_tree *tree, guint meth_len)
> {
> 	char	*string;
> 
>         /*
>          * We know we have the entire method; otherwise, "sip_parse_line()"
>          * would have returned OTHER_LINE.
>          */
>         string = tvb_get_string(tvb, 0, meth_len);
>         proto_tree_add_string(tree, hf_Method, tvb, 0, meth_len, string);
> 		
> 		/* Copy request method for telling tap */
> 		stat_info->request_method = g_malloc(meth_len+1);
> 		strncpy(stat_info->request_method, string, meth_len+1);
> 		
>         /* String no longer needed */
>         g_free(string);
> }
> which seems to be fixed by "if(tree)" in version 1.62 around line 873 :
> string = tvb_get_string(tvb, 0, meth_len);
>   if (tree) {

No, I think it's fixed by moving the initialization of "stat_info" to
"dissect_sip_common()", so that a sip_info_value_t is allocated even when
the heuristic and SIP-over-TCP dissectors are used.