1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

checker: Ensure that the processor is reset before checking each domain. (#523)

This commit is contained in:
Sascha L. Teichmann 2024-01-15 08:59:58 +01:00 committed by GitHub
parent 6c8b3757aa
commit 9a1c66eb8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,8 +202,8 @@ func (p *processor) close() {
}
}
// clean clears the fields values of the given processor.
func (p *processor) clean() {
// reset clears the fields values of the given processor.
func (p *processor) reset() {
p.redirects = nil
p.noneTLS = nil
for k := range p.alreadyChecked {
@ -247,6 +247,8 @@ func (p *processor) run(domains []string) (*Report, error) {
}
for _, d := range domains {
p.reset()
if !p.checkProviderMetadata(d) {
// We cannot build a report if the provider metadata cannot be parsed.
log.Printf("Could not parse the Provider-Metadata.json of: %s\n", d)
@ -287,7 +289,6 @@ func (p *processor) run(domains []string) (*Report, error) {
domain.Passed = rules.eval(p)
report.Domains = append(report.Domains, domain)
p.clean()
}
return &report, nil