Ethereal-dev: [Ethereal-dev] Bug fix in packet-iax2.c

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

From: Peter Johansson <Peter.xc.Johansson@xxxxxxxxxxxx>
Date: Mon, 03 Oct 2005 14:45:56 +0200
The supplied patch resolves an issue with the use of the not yet initialized variable "fid".

/ Regards, Peter
Index: C:/ethereal-win32-libs/epan/dissectors/packet-iax2.c
===================================================================
--- C:/ethereal-win32-libs/epan/dissectors/packet-iax2.c	(revision 16077)
+++ C:/ethereal-win32-libs/epan/dissectors/packet-iax2.c	(working copy)
@@ -1721,9 +1721,9 @@
     /* then we are continuing an already-started pdu */
     frag_len                     = tvb_reported_length( tvb );
     offset                       = 0;
-    tot_len                      = GPOINTER_TO_UINT(g_hash_table_lookup(iax_call->totlen_table, GUINT_TO_POINTER(fid)));
     if(!pinfo->fd->flags.visited) {
       fid = dirdata->current_frag_id;
+      tot_len                      = GPOINTER_TO_UINT(g_hash_table_lookup(iax_call->totlen_table, GUINT_TO_POINTER(fid)));
       g_hash_table_insert( iax_call->fid_table, GUINT_TO_POINTER(pinfo->fd->num), GUINT_TO_POINTER(fid) );
       frag_offset                  = dirdata->current_frag_bytes;
       complete                     = dirdata->current_frag_bytes > tot_len;