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

16 lines
316 B
Plaintext

@banned@
identifier i;
position p1;
@@
\(strtok@i\|sprintf@i\|strcat@i\|strcpy@i\|strncpy@i\|strncat@i\|strndup@i\|strchrnul@i\|rand@i\|rand_r@i\|memmem@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)