As "tvb_strneql()" and "tvb_memeql()" now just return -1, rather than

throwing an exception, if the bytes to be compared aren't available in
the tvbuff, we don't need to check for their existence before calling
those routines.

svn path=/trunk/; revision=7826
This commit is contained in:
Guy Harris 2003-06-10 05:53:33 +00:00
parent eab7ed158b
commit 9d24268f8f
3 changed files with 7 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* Routines for DCERPC packet disassembly * Routines for DCERPC packet disassembly
* Copyright 2001, Todd Sabin <tas@webspan.net> * Copyright 2001, Todd Sabin <tas@webspan.net>
* *
* $Id: packet-dcerpc.c,v 1.127 2003/06/04 05:41:36 guy Exp $ * $Id: packet-dcerpc.c,v 1.128 2003/06/10 05:53:32 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -2997,8 +2997,7 @@ dissect_dcerpc_cn (tvbuff_t *tvb, int offset, packet_info *pinfo,
* the 4 bytes of null padding, and make that the dissector * the 4 bytes of null padding, and make that the dissector
* used for "netbios". * used for "netbios".
*/ */
if (tvb_bytes_exist (tvb, offset, 4) && if (tvb_memeql (tvb, offset, nulls, 4) == 0) {
tvb_memeql (tvb, offset, nulls, 4) == 0) {
/* /*
* Skip the padding. * Skip the padding.

View File

@ -2,7 +2,7 @@
* Routines for Financial Information eXchange (FIX) Protocol dissection * Routines for Financial Information eXchange (FIX) Protocol dissection
* Copyright 2000, PC Drew <drewpc@ibsncentral.com> * Copyright 2000, PC Drew <drewpc@ibsncentral.com>
* *
* $Id: packet-fix.c,v 1.3 2003/05/19 03:23:11 gerald Exp $ * $Id: packet-fix.c,v 1.4 2003/06/10 05:53:33 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -837,7 +837,7 @@ dissect_fix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int value_len = 0; int value_len = 0;
/* get at least the fix version: 8=FIX.x.x */ /* get at least the fix version: 8=FIX.x.x */
if (!tvb_bytes_exist(tvb, 0, 6) || tvb_strneql(tvb, 0, "8=FIX.", 6) != 0) { if (tvb_strneql(tvb, 0, "8=FIX.", 6) != 0) {
/* not a fix packet */ /* not a fix packet */
return FALSE; return FALSE;
} }

View File

@ -1,7 +1,7 @@
/* packet-isdn.c /* packet-isdn.c
* Routines for ISDN packet disassembly * Routines for ISDN packet disassembly
* *
* $Id: packet-isdn.c,v 1.3 2002/11/08 01:00:04 guy Exp $ * $Id: packet-isdn.c,v 1.4 2003/06/10 05:53:33 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -161,14 +161,12 @@ dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* won't do the right thing if the PPP-over-HDLC * won't do the right thing if the PPP-over-HDLC
* headers aren't being used.... * headers aren't being used....
*/ */
if (tvb_bytes_exist(tvb, 0, 3) && if (tvb_memeql(tvb, 0, v120_sabme, 3) == 0) {
tvb_memeql(tvb, 0, v120_sabme, 3) == 0) {
/* /*
* We assume this is V.120. * We assume this is V.120.
*/ */
circuit_set_dissector(circuit, v120_handle); circuit_set_dissector(circuit, v120_handle);
} else if (tvb_bytes_exist(tvb, 0, 2) && } else if (tvb_memeql(tvb, 0, ppp, 2) == 0) {
tvb_memeql(tvb, 0, ppp, 2) == 0) {
/* /*
* We assume this is PPP. * We assume this is PPP.
*/ */