summaryrefslogtreecommitdiffstats
path: root/framework/src/suricata/qa/coccinelle/banned-functions.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/suricata/qa/coccinelle/banned-functions.cocci')
-rw-r--r--framework/src/suricata/qa/coccinelle/banned-functions.cocci15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/src/suricata/qa/coccinelle/banned-functions.cocci b/framework/src/suricata/qa/coccinelle/banned-functions.cocci
new file mode 100644
index 00000000..5913521c
--- /dev/null
+++ b/framework/src/suricata/qa/coccinelle/banned-functions.cocci
@@ -0,0 +1,15 @@
+@banned@
+identifier i;
+position p1;
+@@
+
+\(strtok@i\|sprintf@i\|strcat@i\|strcpy@i\|strncpy@i\|strncat@i\|strndup@i\|strchrdup@i\)(...)@p1
+
+@script:python@
+p1 << banned.p1;
+i << banned.i;
+@@
+
+print("Banned function '%s' used at %s:%s" % (i, p1[0].file, p1[0].line))
+import sys
+sys.exit(1)