]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
cocci: fix python issues
authorVictor Julien <vjulien@oisf.net>
Wed, 21 Sep 2022 08:17:38 +0000 (10:17 +0200)
committerVictor Julien <vjulien@oisf.net>
Sat, 26 Nov 2022 10:04:00 +0000 (11:04 +0100)
(cherry picked from commit 353eb9086daad9b8e00eca8fe4cc420ab79496bd)

qa/coccinelle/access-pkt-packet.cocci
qa/coccinelle/action-pkt.cocci
qa/coccinelle/direct-packet.cocci
qa/coccinelle/malloc-error-check.cocci
qa/coccinelle/pktnotset-packet.cocci
qa/coccinelle/realloc.cocci
qa/coccinelle/siginit.cocci
qa/coccinelle/size_t.cocci
qa/coccinelle/sz3.cocci
qa/coccinelle/uint.cocci

index 681848ecf347c0e97f6d208a97af5e6ee576baed..3402b6defa100f89a56950dfd506cb5a7feea802 100644 (file)
@@ -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)
index 1a66721ac8a1063009731aa93d792b4537ce28ec..1392d5e8ef2b6b30d27f76cf22865e8abb015a12 100644 (file)
@@ -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)
index dbe1f98bcca489923ae0880e59852f10f1dba5ce..b184225f7190c568c60a89ea2fc64a730dc24a78 100644 (file)
@@ -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)
index b245189a23b4a04faf3558e08103cc7ad099f119..444f59f5c5abf2c240fc7cc3c635c92d74a6f028 100644 (file)
@@ -58,6 +58,6 @@ BUG_ON(x == NULL)
 @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)
index ab6a98c1d06edcde0b2fe9d305d8bd51cbd7cb9f..ff01542d43c8991d04077f2d8eeec0e2d7c8ed35 100644 (file)
@@ -24,6 +24,6 @@ PACKET_INITIALIZE(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)
index 0b828807359d76bfef222ad1b6ca4d95eaa8cf1c..e9c4fc6c6b8be37c45a0959f56e9fa8b8278fea5 100644 (file)
@@ -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)
index 9a2193be408df4aa80b790c71581980d9af97097..2bfcbd678f30dd5f7a0835230da6b3cd674d56c7 100644 (file)
@@ -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)
index 4bd5b9f26c9e5a0159709b1278bd2de4a7b51f8d..89a13f8ed397886902b100f0be8c95fa1c217ef7 100644 (file)
@@ -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)
index 37a8877b42cf4e9a24e42222aa21335a1c028878..51459c7be23c13f628683963280374b92d33b532 100644 (file)
@@ -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)
index 2c664288e3804f7e904829ef7052091e777a035c..d7e6af773cbacee5d8e07502a246a43c33e75f73 100644 (file)
@@ -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)