aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-29 00:16:22 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-29 00:16:22 +0000
commite3a76369d1d87ee837a9504a81773776d762f9b1 (patch)
tree3365b95767d48ce88af121e622b0047d9956b0bc /epan/dissectors/packet-ncp2222.inc
parent6a4b4fc1b95fe8bd87c50ddbe343d72d7783c43c (diff)
Break out of a really large (but not infinite) loop.
svn path=/trunk/; revision=14226
Diffstat (limited to 'epan/dissectors/packet-ncp2222.inc')
-rw-r--r--epan/dissectors/packet-ncp2222.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 97662b61c4..36749acd27 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -1762,7 +1762,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
guint32 value4 = 0;
guint32 value5 = 0;
guint32 value6 = 0;
- guint32 voffset = 0;
+ guint32 voffset = 0, oldvoffset;
guint32 icounter;
guint32 number_of_values = 0;
guint32 number_of_items = 0;
@@ -1791,10 +1791,16 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
nvtree = proto_item_add_subtree(vitem, ett_nds);
+ oldvoffset = voffset;
voffset = voffset + 4;
for (icounter = 1 ; icounter <= number_of_values; icounter++ )
{
+ if (oldvoffset >= voffset) {
+ proto_tree_add_text(nvtree, tvb, 0, 0, "[ Invalid offset: %u ]", voffset);
+ return;
+ }
+ oldvoffset = voffset;
switch(syntax_type)
{
case 0x00000006: /* Case Insensitive List */