aboutsummaryrefslogtreecommitdiffstats
path: root/packet-spnego.c
diff options
context:
space:
mode:
authorsharpe <sharpe@f5534014-38df-0310-8fa8-9805f1628bb7>2003-06-01 20:34:20 +0000
committersharpe <sharpe@f5534014-38df-0310-8fa8-9805f1628bb7>2003-06-01 20:34:20 +0000
commit4b9e8484e439632f44d289b68e0075fa44d73d98 (patch)
tree37db18262d7b6dbb0b46d2edca9be1dd60a97bed /packet-spnego.c
parent0d9432645843c9bbcc5f20c3f48fcf22c204993f (diff)
Fix a small segmentation fault if we get an ASN.1 parse error, and
start to work on kerberos flags etc. Also prettied up the case where the responseToken was an empty string. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7767 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-spnego.c')
-rw-r--r--packet-spnego.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/packet-spnego.c b/packet-spnego.c
index 1fe8a4128f..581f61ae1d 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.49 2003/05/26 20:44:20 guy Exp $
+ * $Id: packet-spnego.c,v 1.50 2003/06/01 20:34:20 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1106,19 +1106,26 @@ dissect_spnego_responseToken(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
offset = hnd->offset;
- item = proto_tree_add_item(tree, hf_spnego_responsetoken, tvb, offset,
- nbytes, FALSE);
+ item = proto_tree_add_item(tree, hf_spnego_responsetoken, tvb, offset -2 ,
+ nbytes + 2, FALSE);
subtree = proto_item_add_subtree(item, ett_spnego_responsetoken);
+
/*
* Now, we should be able to dispatch after creating a new TVB.
+ * However, we should make sure that there is something in the
+ * response token ...
*/
- token_tvb = tvb_new_subset(tvb, offset, nbytes, -1);
- if (next_level_dissector)
- call_dissector(next_level_dissector, token_tvb, pinfo, subtree);
-
+ if (nbytes) {
+ token_tvb = tvb_new_subset(tvb, offset, nbytes, -1);
+ if (next_level_dissector)
+ call_dissector(next_level_dissector, token_tvb, pinfo, subtree);
+ }
+ else {
+ proto_tree_add_text(subtree, tvb, offset-2, 2, "<Empty String>");
+ }
hnd->offset += nbytes; /* Update this ... */
done:
@@ -1660,4 +1667,9 @@ proto_reg_handoff_spnego(void)
gssapi_init_oid("1.2.840.113554.1.2.2", proto_spnego_krb5, ett_spnego_krb5,
spnego_krb5_handle, spnego_krb5_wrap_handle,
"KRB5 - Kerberos 5");
+
+ /*
+ * Find the data handle for some calls
+ */
+ data_handle = find_dissector("data");
}