conformance skip
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Mar 2022 13:29:44 +0000 (14:29 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 25 Apr 2024 11:26:53 +0000 (13:26 +0200)
epan/dissectors/packet-dcerpc.c

index 1c6d4c669577c193aa05b1ab4f3b257e6a3bdb9e..debfa4bd04fb7b337d1945f33ae334ddaeb2be57 100644 (file)
@@ -2464,6 +2464,10 @@ dissect_ndr_ucarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
     }
 
     if (di->conformant_run) {
+        return offset;
+    }
+
+    {
         guint64 val;
 
         /* conformant run, just dissect the max_count header */
@@ -2473,9 +2477,6 @@ dissect_ndr_ucarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
                                        hf_dcerpc_array_max_count, &val);
         di->array_max_count = (gint32)val;
         di->array_max_count_offset = offset-conformance_size;
-        di->conformant_run = 1;
-        di->conformant_eaten = offset-old_offset;
-    } else {
         /* we don't remember where in the bytestream this field was */
         proto_tree_add_uint(tree, hf_dcerpc_array_max_count, tvb, di->array_max_count_offset, conformance_size, di->array_max_count);
 
@@ -2528,11 +2529,14 @@ dissect_ndr_ucvarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
     }
 
     if (di->conformant_run) {
+        return offset;
+    }
+
+    {
         guint64 val;
 
         /* conformant run, just dissect the max_count header */
         old_offset = offset;
-        di->conformant_run = 0;
         offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep,
                                        hf_dcerpc_array_max_count, &val);
         DISSECTOR_ASSERT(val <= G_MAXUINT32);
@@ -2548,9 +2552,6 @@ dissect_ndr_ucvarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
         DISSECTOR_ASSERT(val <= G_MAXUINT32);
         di->array_actual_count = (guint32)val;
         di->array_actual_count_offset = offset-conformance_size;
-        di->conformant_run = 1;
-        di->conformant_eaten = offset-old_offset;
-    } else {
         /* we don't remember where in the bytestream these fields were */
         proto_tree_add_uint(tree, hf_dcerpc_array_max_count, tvb, di->array_max_count_offset, conformance_size, di->array_max_count);
         proto_tree_add_uint(tree, hf_dcerpc_array_offset, tvb, di->array_offset_offset, conformance_size, di->array_offset);
@@ -2605,11 +2606,14 @@ dissect_ndr_uvarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
     }
 
     if (di->conformant_run) {
+        return offset;
+    }
+
+    {
         guint64 val;
 
         /* conformant run, just dissect the max_count header */
         old_offset = offset;
-        di->conformant_run = 0;
         offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, di, drep,
                                        hf_dcerpc_array_offset, &val);
         DISSECTOR_ASSERT(val <= G_MAXUINT32);
@@ -2620,9 +2624,6 @@ dissect_ndr_uvarray_core(tvbuff_t *tvb, gint offset, packet_info *pinfo,
         DISSECTOR_ASSERT(val <= G_MAXUINT32);
         di->array_actual_count = (guint32)val;
         di->array_actual_count_offset = offset-conformance_size;
-        di->conformant_run = 1;
-        di->conformant_eaten = offset-old_offset;
-    } else {
         /* we don't remember where in the bytestream these fields were */
         proto_tree_add_uint(tree, hf_dcerpc_array_offset, tvb, di->array_offset_offset, conformance_size, di->array_offset);
         proto_tree_add_uint(tree, hf_dcerpc_array_actual_count, tvb, di->array_actual_count_offset, conformance_size, di->array_actual_count);