summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-08-06 22:54:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-08-06 22:54:33 (GMT)
commit453825b9435ec5740fcada42cebe246325a07c37 (patch)
treeb59dacf1a6815c87e3c16a419301e6aae3cdb8a5
parent8bbd5527b66e1edd0a4a8a955dba095042b22f59 (diff)
Clean the code for ROST namespaces.
-rw-r--r--src/analysis/scan/space.c33
-rw-r--r--tests/analysis/scan/fuzzing.py19
2 files changed, 17 insertions, 35 deletions
diff --git a/src/analysis/scan/space.c b/src/analysis/scan/space.c
index dc9a237..1e158cf 100644
--- a/src/analysis/scan/space.c
+++ b/src/analysis/scan/space.c
@@ -58,9 +58,6 @@ static char *g_scan_namespace_get_name(const GScanNamespace *);
/* Lance une résolution d'élément à solliciter. */
static bool g_scan_namespace_resolve(GScanNamespace *, const char *, GScanContext *, GScanScope *, GRegisteredItem **);
-/* Réduit une expression à une forme plus simple. */
-static GScanExpression *g_scan_namespace_reduce(GScanNamespace *, GScanContext *, GScanExpression **, size_t, bool);
-
/* ---------------------------------------------------------------------------------- */
@@ -98,7 +95,6 @@ static void g_scan_namespace_class_init(GScanNamespaceClass *klass)
registered->get_name = (get_registered_item_name_fc)g_scan_namespace_get_name;
registered->resolve = (resolve_registered_item_fc)g_scan_namespace_resolve;
- registered->reduce = (reduce_registered_item_fc)g_scan_namespace_reduce;
}
@@ -355,32 +351,3 @@ static bool g_scan_namespace_resolve(GScanNamespace *item, const char *target, G
return result;
}
-
-
-/******************************************************************************
-* *
-* Paramètres : space = élément d'appel à consulter. *
-* ctx = contexte de suivi de l'analyse courante. *
-* args = liste d'éventuels arguments fournis. *
-* count = taille de cette liste. *
-* final = indique une ultime conversion dans le cycle en cours.*
-* *
-* Description : Réduit une expression à une forme plus simple. *
-* *
-* Retour : Réduction correspondante, expression déjà réduite, ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GScanExpression *g_scan_namespace_reduce(GScanNamespace *space, GScanContext *ctx, GScanExpression **args, size_t count, bool final)
-{
- GScanExpression *result; /* Instance à renvoyer */
-
- assert(false); /* REMME */
-
- result = NULL;
-
- return result;
-
-}
diff --git a/tests/analysis/scan/fuzzing.py b/tests/analysis/scan/fuzzing.py
index 2140972..6eecac9 100644
--- a/tests/analysis/scan/fuzzing.py
+++ b/tests/analysis/scan/fuzzing.py
@@ -1,5 +1,5 @@
-from chrysacase import ChrysalideTestCase
+from common import RostTestClass
from pychrysalide.analysis.contents import MemoryContent
from pychrysalide.analysis.scan import ContentScanner
from pychrysalide.analysis.scan import ScanOptions
@@ -7,7 +7,7 @@ from pychrysalide.analysis.scan.patterns.backends import AcismBackend
from pychrysalide.analysis.scan.patterns.backends import BitapBackend
-class TestRostFuzzingFixes(ChrysalideTestCase):
+class TestRostFuzzingFixes(RostTestClass):
"""TestCases to remember all the fixes for crashes identified by fuzzing."""
def testEmptyPatternListWithContent(self):
@@ -63,3 +63,18 @@ rule test {
with self.assertRaisesRegex(ValueError, 'Unable to create content scanner'):
scanner = ContentScanner(rule)
+
+
+ def testNamespacesWithoutReductionCode(self):
+ """Clean the code for ROST namespaces."""
+
+ rule = '''
+rule test {
+
+ condition:
+ console
+
+}
+'''
+
+ self.check_rule_failure(rule)