aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-giop.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-17 18:28:50 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-17 18:28:50 +0000
commit02f67fd19f4a275778c1884fcf38263b33003860 (patch)
tree9f400128a9a80452c4833d1737175d9d3eab290b /epan/dissectors/packet-giop.c
parent8e46cb49b7e608a1c7c6a7c2fe1a4080de0732a9 (diff)
Add some length checking.
svn path=/trunk/; revision=14113
Diffstat (limited to 'epan/dissectors/packet-giop.c')
-rw-r--r--epan/dissectors/packet-giop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index f2ab639b25..4c241ed123 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -4787,8 +4787,11 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
/* return if zero length sequence */
if (seqlen == 0) {
- if (tf)
+ if (tf) {
+ if (*offset - start_offset <= 0)
+ THROW(ReportedBoundsError);
proto_item_set_len(tf, *offset - start_offset);
+ }
return;
}
@@ -4876,8 +4879,11 @@ void decode_ServiceContextList(tvbuff_t *tvb, proto_tree *ptree, int *offset,
} /* for seqlen */
- if (tf)
+ if (tf) {
+ if (*offset - start_offset <= 0)
+ THROW(ReportedBoundsError);
proto_item_set_len(tf, *offset - start_offset);
+ }
}