aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2007-11-18 16:20:51 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2007-11-18 16:20:51 +0000
commitddc4d639ba5549ff402cd6b23c611ea1330405bb (patch)
treef0cd747bc8e0768002ed41b9f9cd9dc4da739907 /epan
parent04b798cbf4df9161e4cd1cf91bff887cf0dfc19f (diff)
As proposed by Martin Peylo:
Do not stop processing if the length of a choice has the (illegal) value of zero. svn path=/trunk/; revision=23485
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ber.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index fbd4c0eaaf..d70fdfb4ba 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -2560,6 +2560,14 @@ printf("CHOICE dissect_ber_choice(%s) entered len:%d\n",name,tvb_length_remainin
offset=get_ber_length(tvb, offset, &len, &ind);
end_offset = offset + len ;
+ /* do not stop processing if the length has the (illegal) value of zero */
+ if(len == 0) {
+ item = proto_tree_add_text(tree, tvb, offset, len, "BER Error: Empty choice field was found");
+ proto_item_set_expert_flags(item, PI_MALFORMED, PI_WARN);
+ expert_add_info_format(actx->pinfo, item, PI_MALFORMED, PI_WARN, "BER Error: Empty choice field was found");
+ return offset;
+ }
+
/* Some sanity checks.
* The hf field passed to us MUST be an integer type
*/
@@ -2786,6 +2794,14 @@ printf("CHOICE dissect_ber_old_choice(%s) entered len:%d\n",name,tvb_length_rema
offset=get_ber_length(tvb, offset, &len, &ind);
end_offset = offset + len ;
+ /* do not stop processing if the length has the (illegal) value of zero */
+ if(len == 0) {
+ item = proto_tree_add_text(tree, tvb, offset, len, "BER Error: Empty choice field was found");
+ proto_item_set_expert_flags(item, PI_MALFORMED, PI_WARN);
+ expert_add_info_format(actx->pinfo, item, PI_MALFORMED, PI_WARN, "BER Error: Empty choice field was found");
+ return offset;
+ }
+
/* Some sanity checks.
* The hf field passed to us MUST be an integer type
*/