cocci: fix python issues

pull/7954/head
Victor Julien 2 years ago
parent 839a4f5ab4
commit 353eb9086d

@ -30,7 +30,7 @@ p->pkt@p1
p1 << pktfield.p1;
@@
print "Invalid Packet->pkt usage, GET_PKT_DATA macro must be used at %s:%s" % (p1[0].file, p1[0].line)
print("Invalid Packet->pkt usage, GET_PKT_DATA macro must be used at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)
@ -50,6 +50,6 @@ p->pktlen@p1
p1 << pktlenfield.p1;
@@
print "Invalid Packet->pktlen usage, GET_PKT_LEN macro must be used at %s:%s" % (p1[0].file, p1[0].line)
print("Invalid Packet->pktlen usage, GET_PKT_LEN macro must be used at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -10,6 +10,6 @@ p->action@p1
p1 << action.p1;
@@
print "Invalid usage of p->action, please use macro at %s:%s" % (p1[0].file, p1[0].line)
print("Invalid usage of p->action, please use macro at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -10,6 +10,6 @@ Packet p@p1;
p1 << directpacket.p1;
@@
print "Invalid Packet definition, explicit allocation must be used at %s:%s" % (p1[0].file, p1[0].line)
print("Invalid Packet definition, explicit allocation must be used at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -64,6 +64,6 @@ FAIL_IF_NULL(x)
@script:python depends on !realloc && !istested && !inlinetested@
p1 << malloced.p1;
@@
print "Structure malloced at %s:%s but error is not checked." % (p1[0].file, p1[0].line)
print("Structure malloced at %s:%s but error is not checked." % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -24,6 +24,6 @@ PacketInit(p)
p1 << zeroed.p1;
@@
print "Packet zeroed at %s:%s but pkt field is not set afterward." % (p1[0].file, p1[0].line)
print("Packet zeroed at %s:%s but pkt field is not set afterward." % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -13,6 +13,6 @@ x@p1 = (ty *) SCRealloc(x, E)
@script:python@
p1 << realloc.p1;
@@
print "Structure reallocated at %s:%s but original pointer is lost and not freed in case of error." % (p1[0].file, p1[0].line)
print("Structure reallocated at %s:%s but original pointer is lost and not freed in case of error." % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -21,6 +21,6 @@ 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)
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)

@ -39,6 +39,6 @@ funcn(E1, E2,..., (uint64_t) p, ...)@p1;
p1 << sizet.p1;
@@
print "Invalid printf with size_t (not casted to uintmax_t) at %s:%s" % (p1[0].file, p1[0].line)
print("Invalid printf with size_t (not casted to uintmax_t) at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -24,7 +24,7 @@ sizeof(e@p1)
p1 << preuse.p1;
@@
print "Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line)
print("Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)
@ -43,6 +43,6 @@ sizeof(e@p1)
p1 << postuse.p1;
@@
print "Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line)
print("Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

@ -8,6 +8,6 @@ i@p1
@script:python@
p1 << uint.p1;
@@
print "banned type uint used at at %s:%s, please use a explicit length." % (p1[0].file, p1[0].line)
print("banned type uint used at at %s:%s, please use a explicit length." % (p1[0].file, p1[0].line))
import sys
sys.exit(1)

Loading…
Cancel
Save