aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x25.c
diff options
context:
space:
mode:
authorOlivier Abad <oabad@noos.fr>2001-07-18 15:49:29 +0000
committerOlivier Abad <oabad@noos.fr>2001-07-18 15:49:29 +0000
commitfc603eaf9a6a0c5e0247f6701235b9196c0ab323 (patch)
tree964ffc5890d494018ec6abc259e96631a5a1ad48 /packet-x25.c
parent624a4884fcd1126eeeb81a4f18c04fd87bf9fb9f (diff)
- get_x25_pkt_len() :
In "call accept" packets, the address block is not mandatory. Check the packet length before trying to read the addresses. svn path=/trunk/; revision=3739
Diffstat (limited to 'packet-x25.c')
-rw-r--r--packet-x25.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/packet-x25.c b/packet-x25.c
index 8ae8179303..01f71eb1f9 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for x25 packet disassembly
* Olivier Abad <oabad@cybercable.fr>
*
- * $Id: packet-x25.c,v 1.52 2001/07/16 20:57:42 guy Exp $
+ * $Id: packet-x25.c,v 1.53 2001/07/18 15:49:29 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1386,6 +1386,11 @@ get_x25_pkt_len(tvbuff_t *tvb)
return MIN(tvb_reported_length(tvb),length);
case X25_CALL_ACCEPTED:
+ /* The calling/called address length byte (following the packet type)
+ * is not mandatory, so we must check the packet length before trying
+ * to read it */
+ if (tvb_reported_length(tvb) == 3)
+ return(3);
bytex = tvb_get_guint8(tvb, 3);
called_len = (bytex >> 0) & 0x0F;
calling_len = (bytex >> 4) & 0x0F;