You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/qa/coccinelle/banned-functions.cocci

18 lines
281 B
Plaintext

@banned@
identifier func ~= "^\(sprintf\|strcat\|strcpy\|strncpy\|strncat\)$";
position p1;
@@
<+...
func(...)@p1
...+>
@ script:python @
p1 << banned.p1;
func << banned.func;
@@
print "Banned function %s() used at %s:%s" % (func, p1[0].file, p1[0].line)
import sys
sys.exit(1)