summaryrefslogtreecommitdiffstats
path: root/qa/coccinelle/siginit.cocci
blob: 2bfcbd678f30dd5f7a0835230da6b3cd674d56c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@siginit@
identifier func =~ "Detect.*Setup";
expression E1;
position p1;
identifier de_ctx, s, str, error;
type DetectEngineCtx, Signature;
@@

func(DetectEngineCtx *de_ctx, Signature *s, char *str) {
...
SigMatchAppendSMToList(s, ...)@p1;
...
if (s->alproto != E1 && ...) {
...
goto error;
}
...
}


@script:python@
p1 << siginit.p1;
@@
print("SigMatch added at %s:%s but error handling can cause it to be freed later." % (p1[0].file, p1[0].line))
import sys
sys.exit(1)