diff options
author | Evan Huus <eapache@gmail.com> | 2013-08-08 10:50:11 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-08-08 10:50:11 +0000 |
commit | 2d2271f12b3b09e14d3624394e96bca88751bd0e (patch) | |
tree | ab570eb3ab0bbb2acb445938a89926ba2d7178fe /epan | |
parent | 77f4bef1545b43b69e921ab47ae0108398a431aa (diff) |
Correctly check bounds on dim_max.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9019
svn path=/trunk/; revision=51213
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-rtps.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c index 0d3f634803..5969db1f81 100644 --- a/epan/dissectors/packet-rtps.c +++ b/epan/dissectors/packet-rtps.c @@ -2074,6 +2074,11 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset dim_max = NEXT_guint32(tvb, offset, little_endian); offset += 4; + if (dim_max > MAX_ARRAY_DIMENSION) { + /* We don't have a tree item to add expert info to... */ + dim_max = MAX_ARRAY_DIMENSION; + } + for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) size[i] = 0; for (i = 0; i < dim_max; ++i) { size[i] = NEXT_guint32(tvb, offset, little_endian); |