From b25dbbeff2a2987cfef6869b04dc15a17dd00dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Fri, 20 Dec 2024 11:42:24 +0100 Subject: [PATCH] add values when using more than 1 filter --- pkg/scanner/detectors/customrule/filters/filters.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/scanner/detectors/customrule/filters/filters.go b/pkg/scanner/detectors/customrule/filters/filters.go index 3cc9fa043..a520b8049 100644 --- a/pkg/scanner/detectors/customrule/filters/filters.go +++ b/pkg/scanner/detectors/customrule/filters/filters.go @@ -167,9 +167,17 @@ func (filter *All) joinMatches(matches, childMatches []Match) []Match { for _, match := range matches { for _, childMatch := range childMatches { if variables, variablesMatch := match.variables.Merge(childMatch.variables); variablesMatch { + value := match.Value() + + if value != nil { + *value += *childMatch.Value() + } else { + value = childMatch.Value() + } + result = append(result, NewMatch( variables, - nil, + value, // FIXME: this seems like it will create unnecessary duplicates append(match.datatypeDetections, childMatch.datatypeDetections...), ))