for content_item in content:
if key_list[key_next_index] == "ANYINDEX" and isinstance(v, dict):
matches = True
- for k2, v2 in target.items():
- k_new_list = k2.split(".")
- new_operator = "eq"
- if k_new_list[-1] in (
- "eq",
- "ne",
- "gt",
- "gte",
- "lt",
- "lte",
- "cont",
- "ncont",
- "neq",
- ):
- new_operator = k_new_list.pop()
- if not recursive_find(
- k_new_list, 0, content_item, new_operator, v2
- ):
- matches = False
- break
+ if target:
+ for k2, v2 in target.items():
+ k_new_list = k2.split(".")
+ new_operator = "eq"
+ if k_new_list[-1] in (
+ "eq",
+ "ne",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "cont",
+ "ncont",
+ "neq",
+ ):
+ new_operator = k_new_list.pop()
+ if not recursive_find(
+ k_new_list, 0, content_item, new_operator, v2
+ ):
+ matches = False
+ break
else:
matches = recursive_find(
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+security:
+ - |
+ Coverity-CWE 476: NULL Pointer Dereference (137978 Bad use of null-like value)
+ Coverity fix for Bad use of null-like value
+