summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-14 13:47:48 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-14 13:47:48 (GMT)
commite30e083de9009e52bec5bc574d9c80de4e49a3c3 (patch)
treec71157508794925b3fff8b09288426b669f9b84a /src/analysis
parent062984a6a4b726dd9060aa1354cf557d942654d9 (diff)
Fix the scan status for some cases.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/scan/rule.c6
-rw-r--r--src/analysis/scan/scanner.c2
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];