diff options
author | Gerald Combs <gerald@wireshark.org> | 2004-12-09 16:37:46 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2004-12-09 16:37:46 +0000 |
commit | c3a4d2b14f5ce5a4823fbc86e760c0e785cec428 (patch) | |
tree | 84d777a26d5c2ec43e2b44f34d1bc24302872810 | |
parent | ec085fdae981e03015218533c7e3548b039a515e (diff) |
Add another token size check.
svn path=/trunk/; revision=12697
-rw-r--r-- | epan/dissectors/packet-tds.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index f9636881e1..8de35e9881 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -743,6 +743,14 @@ dissect_tds_query5_packet(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre token_sz = tds_get_variable_token_size(tvb, pos+1, token, &token_len_field_size, &token_len_field_val); + /* XXX - Should this check be done in tds_get_variable_token_size() + * instead? */ + if ((int) token_sz < 0) { + proto_tree_add_text(tree, tvb, 0, 0, "Bogus token size: %u", + token_sz); + break; + } + token_item = proto_tree_add_text(tree, tvb, pos, token_sz, "Token 0x%02x %s", token, val_to_str(token, token_names, "Unknown Token Type")); |