aboutsummaryrefslogtreecommitdiffstats
path: root/packet-spnego.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-04-02 22:01:21 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-04-02 22:01:21 +0000
commit9948a1315847123e78ea4a9047df0850eae615da (patch)
tree766dc19fcd2a6868d8edb9c8963048acc480819e /packet-spnego.c
parent696c4f22d905d8f20373a4b11e1701d91f6ba32c (diff)
If the packet is short, dont try to create a blob item that spans beyound the end of the short packet since that will raise an exception and we wont even attempt to dissect those (kerberos usually) bytes that we do have in the packet.
svn path=/trunk/; revision=10546
Diffstat (limited to 'packet-spnego.c')
-rw-r--r--packet-spnego.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/packet-spnego.c b/packet-spnego.c
index 10b6f696f4..be6a7b3453 100644
--- a/packet-spnego.c
+++ b/packet-spnego.c
@@ -5,7 +5,7 @@
* Copyright 2002, Richard Sharpe <rsharpe@ns.aus.com>
* Copyright 2003, Richard Sharpe <rsharpe@richardsharpe.com>
*
- * $Id: packet-spnego.c,v 1.51 2003/07/17 22:17:01 sharpe Exp $
+ * $Id: packet-spnego.c,v 1.52 2004/04/02 22:01:21 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -752,6 +752,14 @@ dissect_spnego_mechToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
offset = hnd->offset;
+
+ /* Dont try to create an item with more bytes than remains in the
+ * frame or we will not even attempt to dissect those bytes we
+ * do have. (since there will be an exception)
+ */
+ if(nbytes>tvb_length_remaining(tvb,offset)){
+ nbytes=tvb_length_remaining(tvb,offset);
+ }
item = proto_tree_add_item(tree, hf_spnego_mechtoken, tvb, offset,
nbytes, FALSE);
subtree = proto_item_add_subtree(item, ett_spnego_mechtoken);