From 4d55fdb51cabcf84396767870ac34e055ffa40e3 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Mon, 1 Jun 2009 22:27:00 +0000 Subject: Fix dissection of telnet window size suboption. This fixes bug 191. svn path=/trunk/; revision=28580 --- epan/dissectors/packet-telnet.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-telnet.c') 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 */ -- cgit v1.2.3