diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-10-14 13:47:48 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-10-14 13:47:48 (GMT) |
commit | e30e083de9009e52bec5bc574d9c80de4e49a3c3 (patch) | |
tree | c71157508794925b3fff8b09288426b669f9b84a /src | |
parent | 062984a6a4b726dd9060aa1354cf557d942654d9 (diff) |
Fix the scan status for some cases.
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/scan/rule.c | 6 | ||||
-rw-r--r-- | src/analysis/scan/scanner.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/analysis/scan/rule.c b/src/analysis/scan/rule.c index 5826db9..d4420b7 100644 --- a/src/analysis/scan/rule.c +++ b/src/analysis/scan/rule.c @@ -665,6 +665,12 @@ void g_scan_rule_output_to_text(const GScanRule *rule, GScanContext *context, bo GBinContent *content; /* Contenu binaire scanné */ char *desc; /* Description de ce contenu */ + /** + * Si la règle n'a pas fait mouche, rien n'est imprimé. + */ + if (!g_scan_context_has_match_for_rule(context, rule->name)) + return; + options = g_scan_context_get_options(context); selected = g_scan_options_has_tag_as_selected(options, NULL); diff --git a/src/analysis/scan/scanner.c b/src/analysis/scan/scanner.c index 7b553e6..57fe0d9 100644 --- a/src/analysis/scan/scanner.c +++ b/src/analysis/scan/scanner.c @@ -530,7 +530,7 @@ GScanContext *g_content_scanner_analyze(GContentScanner *scanner, GScanOptions * global = true; - for (i = 0; i < scanner->rule_count; i++) + for (i = 0; i < scanner->rule_count && global; i++) { rule = scanner->rules[i]; |