diff options
author | Balint Reczey <balint.reczey@ericsson.com> | 2009-06-01 22:27:00 +0000 |
---|---|---|
committer | Balint Reczey <balint.reczey@ericsson.com> | 2009-06-01 22:27:00 +0000 |
commit | 4d55fdb51cabcf84396767870ac34e055ffa40e3 (patch) | |
tree | dc49ff45f1774f79866fa2d5cbc4caed4b482b72 | |
parent | 496e7909bae251b0b5af6f485256df4102492583 (diff) |
Fix dissection of telnet window size suboption.
This fixes bug 191.
svn path=/trunk/; revision=28580
-rw-r--r-- | epan/dissectors/packet-telnet.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c index eddcdcd3b1..bf8354b8a8 100644 --- a/epan/dissectors/packet-telnet.c +++ b/epan/dissectors/packet-telnet.c @@ -136,6 +136,9 @@ typedef struct tn_opt { /* routine to dissect option */ } tn_opt; +static tvbuff_t * +unescape_and_tvbuffify_telnet_option(packet_info *pinfo, tvbuff_t *tvb, int offset, int len); + static void dissect_string_subopt(packet_info *pinfo _U_, const char *optname, tvbuff_t *tvb, int offset, int len, proto_tree *tree) @@ -302,14 +305,14 @@ dissect_htstops_subopt(packet_info *pinfo _U_, const char *optname, tvbuff_t *tv } static void -dissect_naws_subopt(packet_info *pinfo _U_, const char *optname _U_, tvbuff_t *tvb, int offset, - int len _U_, proto_tree *tree) +dissect_naws_subopt(packet_info *pinfo, const char *optname _U_, tvbuff_t *tvb, int offset, + int len, proto_tree *tree) { - proto_tree_add_text(tree, tvb, offset, 2, "Width: %u", - tvb_get_ntohs(tvb, offset)); - offset += 2; - proto_tree_add_text(tree, tvb, offset, 2, "Height: %u", - tvb_get_ntohs(tvb, offset)); + tvbuff_t * unpacked_tvb = unescape_and_tvbuffify_telnet_option(pinfo, tvb, offset, len); + proto_tree_add_text(tree, unpacked_tvb, 0, 2, "Width: %u", + tvb_get_ntohs(unpacked_tvb, 0)); + proto_tree_add_text(tree, unpacked_tvb, 2, 2, "Height: %u", + tvb_get_ntohs(unpacked_tvb, 2)); } /* BEGIN RFC-2217 (COM Port Control) Definitions */ |