diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-08-25 08:10:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-08-25 08:10:35 +0000 |
commit | 3f7a9189177534dba614e3ae0aca353ec4b24836 (patch) | |
tree | 426c03daa53f14ae1649d2e91903c320ac3e1db0 | |
parent | ce4e15b76d61c55ca1f9d86dbcd12323ac2720e9 (diff) |
If the length of a GSS token is zero, it's a null token, and the opaque
data shouldn't be dissected.
svn path=/trunk/; revision=19027
-rw-r--r-- | epan/dissectors/packet-rpc.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 04235938c9..e8bf6a780d 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -1036,19 +1036,21 @@ dissect_rpc_authgss_token(tvbuff_t* tvb, proto_tree* tree, int offset, tvb, offset+0, 4, opaque_length); } offset += 4; - length = tvb_length_remaining(tvb, offset); - reported_length = tvb_reported_length_remaining(tvb, offset); - DISSECTOR_ASSERT(length >= 0); - DISSECTOR_ASSERT(reported_length >= 0); - if (length > reported_length) - length = reported_length; - if ((guint32)length > opaque_length) - length = opaque_length; - if ((guint32)reported_length > opaque_length) - reported_length = opaque_length; - new_tvb = tvb_new_subset(tvb, offset, length, reported_length); - len_consumed = call_dissector(gssapi_handle, new_tvb, pinfo, gtree); - offset += len_consumed; + if (opaque_length != 0) { + length = tvb_length_remaining(tvb, offset); + reported_length = tvb_reported_length_remaining(tvb, offset); + DISSECTOR_ASSERT(length >= 0); + DISSECTOR_ASSERT(reported_length >= 0); + if (length > reported_length) + length = reported_length; + if ((guint32)length > opaque_length) + length = opaque_length; + if ((guint32)reported_length > opaque_length) + reported_length = opaque_length; + new_tvb = tvb_new_subset(tvb, offset, length, reported_length); + len_consumed = call_dissector(gssapi_handle, new_tvb, pinfo, gtree); + offset += len_consumed; + } offset = rpc_roundup(offset); return offset; } |