aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
diff options
context:
space:
mode:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2008-08-04 02:56:47 +0000
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2008-08-04 02:56:47 +0000
commit3ac8a3018e8edbb31ec0349b581d80ed18043177 (patch)
tree1f57c9b19ff51412d9aa7250bd26c9ebafc2fdf7 /epan/dissectors/packet-ncp2222.inc
parent674d5080d209d21de28b2ced9ce266d9970e8140 (diff)
Fix 2 bugs:
- Misplaced } resulted in incorrect program flow in switch statement; - Invalid input caused "Dissector bug: infinite loop"; git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25913 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ncp2222.inc')
-rw-r--r--epan/dissectors/packet-ncp2222.inc42
1 files changed, 25 insertions, 17 deletions
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 90bd31926e..c1f0b0365b 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -6588,24 +6588,32 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
values->vstring = get_string(tvb, ioffset, value2);
proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
value2, values->vstring);
- ioffset += value2;
-
- }
- }
- values->voffset=ioffset;
- break;
- default: /* All other name types are just a string */
- values->vstring = get_string(tvb, ioffset, values->vlength);
- proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
- values->vlength, values->vstring);
- values->voffset=ioffset + values->vlength;
- ioffset = values->voffset;
- ioffset += align_4(tvb, ioffset);
- break;
- }
+ ioffset += value2;
+ }
+ /* XXX: What if "multiple items" ? */
+ /* What if "Undefined ... " ? */
+ /* For now: we'll just keep on walking... */
+ /* Presumably we'll get a ReportedBoundsError */
+ /* pretty quickly. */
+ else /* Undefined or "multiple items" ... */
+ {
+ ioffset += 4;
+ }
+ } /* for */
+ } /* else */
+ values->voffset=ioffset;
+ break;
+ default: /* All other name types are just a string */
+ values->vstring = get_string(tvb, ioffset, values->vlength);
+ proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
+ values->vlength, values->vstring);
+ values->voffset=ioffset + values->vlength;
+ ioffset = values->voffset;
+ ioffset += align_4(tvb, ioffset);
break;
- }
- break;
+ } /* switch (values->vflags) */
+ break;
+
case MVTYPE_PROCESS_ITERATOR: /* Process Iterator subverbs. */
temp_values.vvalue = tvb_get_letohl(tvb, ioffset);