summaryrefslogtreecommitdiffstats
path: root/cocci/dns_message_create.spatch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 07:24:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 07:24:22 +0000
commit45d6379135504814ab723b57f0eb8be23393a51d (patch)
treed4f2ec4acca824a8446387a758b0ce4238a4dffa /cocci/dns_message_create.spatch
parentInitial commit. (diff)
downloadbind9-45d6379135504814ab723b57f0eb8be23393a51d.tar.xz
bind9-45d6379135504814ab723b57f0eb8be23393a51d.zip
Adding upstream version 1:9.16.44.upstream/1%9.16.44upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cocci/dns_message_create.spatch')
-rw-r--r--cocci/dns_message_create.spatch84
1 files changed, 84 insertions, 0 deletions
diff --git a/cocci/dns_message_create.spatch b/cocci/dns_message_create.spatch
new file mode 100644
index 0000000..bab6d58
--- /dev/null
+++ b/cocci/dns_message_create.spatch
@@ -0,0 +1,84 @@
+@@
+statement S;
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- if (V != ISC_R_SUCCESS) S
+
+@@
+statement S1, S2;
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- if (V == ISC_R_SUCCESS)
+ S1
+- else S2
+
+@@
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- check_result(V, ...);
+
+@@
+@@
+
+- CHECK(
+ dns_message_create(...)
+- )
+ ;
+
+@@
+@@
+
+- DO(...,
+ dns_message_create(...)
+- )
+ ;
+
+@@
+@@
+
+- RETERR(
+ dns_message_create(...)
+- )
+ ;
+
+@@
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- assert_int_equal(V, ISC_R_SUCCESS);
+
+@@
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- CHECK(..., V);
+
+@@
+expression V;
+statement S;
+@@
+
+- V =
+ dns_message_create(...);
+- if (ISC_UNLIKELY(V != ISC_R_SUCCESS)) S
+
+@@
+expression V;
+@@
+
+- V =
+ dns_message_create(...);
+- RUNTIME_CHECK(V == ISC_R_SUCCESS);