Skip to content

Commit

Permalink
fix(secrets): skip empty match (#6849)
Browse files Browse the repository at this point in the history
fix empty match
  • Loading branch information
omryMen authored Nov 18, 2024
1 parent 4115b0b commit e21fb74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions checkov/secrets/plugins/custom_regex_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def _find_potential_secret(
current_regex_to_metadata: dict[str, dict[str, Any]] = self.multiline_regex_to_metadata if is_multiline else self.regex_to_metadata
kwargs["regex_denylist"] = current_denylist
for match, regex in self.analyze_string(string_to_analyze, **kwargs):
if len(match) == 0:
# Skip empty matches
continue
try:
verified_result = call_function_with_arguments(self.verify, secret=match, context=context)
is_verified = True if verified_result == VerifiedResult.VERIFIED_TRUE else False
Expand Down

0 comments on commit e21fb74

Please sign in to comment.