aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-telnet.c
diff options
context:
space:
mode:
authorBalint Reczey <balint.reczey@ericsson.com>2009-06-01 22:27:00 +0000
committerBalint Reczey <balint.reczey@ericsson.com>2009-06-01 22:27:00 +0000
commit4d55fdb51cabcf84396767870ac34e055ffa40e3 (patch)
treedc49ff45f1774f79866fa2d5cbc4caed4b482b72 /epan/dissectors/packet-telnet.c
parent496e7909bae251b0b5af6f485256df4102492583 (diff)
Fix dissection of telnet window size suboption.
This fixes bug 191. svn path=/trunk/; revision=28580
Diffstat (limited to 'epan/dissectors/packet-telnet.c')
-rw-r--r--epan/dissectors/packet-telnet.c17
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 */