diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-07-07 06:32:43 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-07-07 06:32:43 (GMT) |
commit | 4c10dfa2a95cea6fc704d68066d0c284cfd79342 (patch) | |
tree | 5827bbc411459800747e21929daecdf99fde7dfd /src/analysis/scan/context.c | |
parent | 3f996be1e5858b54740bf92515795982a16b169a (diff) |
Rewrite core parts of the ROST API.
Diffstat (limited to 'src/analysis/scan/context.c')
-rw-r--r-- | src/analysis/scan/context.c | 8 |
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 */ |