aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-telnet.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-03-13 05:48:43 +0000
committerGerald Combs <gerald@wireshark.org>2005-03-13 05:48:43 +0000
commit9d5ee3cfea8739a71237dc97233145e33e2cb74b (patch)
tree3e000d389b514190aeca02a2863ce5e11d36b1d6 /epan/dissectors/packet-telnet.c
parent40477932867e3f4e97abe21eb45f58f4e460299b (diff)
Fix a check for the number of suboptions.
svn path=/trunk/; revision=13739
Diffstat (limited to 'epan/dissectors/packet-telnet.c')
-rw-r--r--epan/dissectors/packet-telnet.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c
index 74ea55acc1..63441bf3f5 100644
--- a/epan/dissectors/packet-telnet.c
+++ b/epan/dissectors/packet-telnet.c
@@ -1166,7 +1166,7 @@ telnet_sub_option(packet_info *pinfo, proto_tree *telnet_tree, tvbuff_t *tvb, in
guint8 opt_byte;
int subneg_len;
const char *opt;
- gint ett;
+ gint ett = ett_telnet_subopt;;
int iac_offset;
guint len;
void (*dissect)(packet_info *, const char *, tvbuff_t *, int, int, proto_tree *);
@@ -1177,16 +1177,13 @@ telnet_sub_option(packet_info *pinfo, proto_tree *telnet_tree, tvbuff_t *tvb, in
/* Get the option code */
opt_byte = tvb_get_guint8(tvb, offset);
- if (opt_byte > NOPTIONS) {
+ if (opt_byte >= NOPTIONS) {
opt = "<unknown option>";
- ett = ett_telnet_subopt;
dissect = NULL;
} else {
opt = options[opt_byte].name;
if (options[opt_byte].subtree_index != NULL)
ett = *(options[opt_byte].subtree_index);
- else
- ett = ett_telnet_subopt;
dissect = options[opt_byte].dissect;
}
offset++;