Ethereal-dev: [ethereal-dev] Patch for packet-h1.c

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

From: "Gerrit Gehnen" <G.Gehnen@xxxxxxxx>
Date: Mon, 08 May 2000 17:05:57 +0200
Hello,

I found a bug in my packet-h1.c. Attached is a patch for it against
the nightly build 2000-05-07.
As side effect it improves the ability for heuristic dissection.

  Gerrit
-- 
Dr.-Ing. Gerrit Gehnen      Abt. LT
ATR Industrie-Elektronik    Textilstraße 2, 41751 Viersen, Germany
Tel. (+49)2162 485-362      Fax (+49)2162 485-100
http://www.atrie.de
*** packet-h1.c.org	Sun May  7 22:11:41 2000
--- packet-h1.c	Sun May  7 22:34:48 2000
***************
*** 110,116 ****
    proto_tree *response_tree = NULL;
    proto_tree *empty_tree = NULL;
  
!   unsigned int position = 2;
  
    if (!(pd[offset] == 'S' && pd[offset + 1] == '5')) {
      return FALSE;
--- 110,116 ----
    proto_tree *response_tree = NULL;
    proto_tree *empty_tree = NULL;
  
!   unsigned int position = 3;
  
    if (!(pd[offset] == 'S' && pd[offset + 1] == '5')) {
      return FALSE;
***************
*** 233,240 ****
  		}
  	      break;
  	    default:
! 	      /* TODO: Add Default Handler. */
! 	      break;
  	    }
  	  position += pd[offset + position + 1];	/* Goto next section */
  	}			/* ..while */
--- 233,242 ----
  		}
  	      break;
  	    default:
! 	      /* This is not a valid telegram. So cancel dissection 
!                  and try the next dissector */
!                 return FALSE; 
! 		break;
  	    }
  	  position += pd[offset + position + 1];	/* Goto next section */
  	}			/* ..while */