aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-12-13 17:00:03 +0000
committerGerald Combs <gerald@wireshark.org>2005-12-13 17:00:03 +0000
commitfa312091cec16d2042eb3f14bc6cc17f54f126c4 (patch)
tree0c49768c7a4d5a65dba318f230465d7719d2b0bc /epan/dissectors/packet-ncp2222.inc
parent4ca1ee0a89b1c67b5331d59919c197de6fcea409 (diff)
Throw an exception if we have an invalid offset. Fixes bug 585.
svn path=/trunk/; revision=16780
Diffstat (limited to 'epan/dissectors/packet-ncp2222.inc')
-rw-r--r--epan/dissectors/packet-ncp2222.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index b7e460dc9d..a142ab76fb 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -1280,6 +1280,9 @@ process_struct_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
/* Re-set the tree */
if (rec->sub_ptvc_rec->descr) {
+ if (ptvcursor_current_offset(ptvc) <= offset)
+ THROW(ReportedBoundsError);
+
proto_item_set_len(item, ptvcursor_current_offset(ptvc) - offset);
ptvcursor_set_tree(ptvc, old_tree);
}