diff options
author | oabad <oabad@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-07-18 15:49:29 +0000 |
---|---|---|
committer | oabad <oabad@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-07-18 15:49:29 +0000 |
commit | 8d7cf67c652964bb3fe595ec27755a9ab5bf7a41 (patch) | |
tree | 964ffc5890d494018ec6abc259e96631a5a1ad48 /packet-x25.c | |
parent | d56d16a903d7607162040b5a01cecc60b5c0c3da (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3739 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-x25.c')
-rw-r--r-- | packet-x25.c | 7 |
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; |