summaryrefslogtreecommitdiff
path: root/src/analysis/scan/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/context.c')
-rw-r--r--src/analysis/scan/context.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/analysis/scan/context.c b/src/analysis/scan/context.c
index aec654a..c19b76c 100644
--- a/src/analysis/scan/context.c
+++ b/src/analysis/scan/context.c
@@ -499,7 +499,7 @@ bool g_scan_context_has_match_for_rule(GScanContext *context, const char *name)
cond = NULL;
- for (i = 0; context->cond_count; i++)
+ for (i = 0; i < context->cond_count; i++)
if (strcmp(name, context->conditions[i].name) == 0)
{
cond = &context->conditions[i];
@@ -513,16 +513,14 @@ bool g_scan_context_has_match_for_rule(GScanContext *context, const char *name)
if (!cond->final_reduced)
{
- new = g_scan_expression_reduce(cond->expr, context, false);
+ cond->final_reduced = g_scan_expression_reduce(cond->expr, context, NULL, &new);
- if (new != NULL)
+ if (cond->final_reduced && new != NULL)
{
g_object_unref(G_OBJECT(cond->expr));
cond->expr = new;
}
- cond->final_reduced = true;
-
}
/* Tentative de récupération d'un bilan final */