summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-12 09:09:42 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-12 09:09:42 +0200
commitededfdb4d19be8f934b52164073f90f0de17c3b3 (patch)
treeefeeabe37da93b73bdd733a92b38effdac661827 /tools
parentbgpd: Reuse index from argv_find only if found (diff)
downloadfrr-ededfdb4d19be8f934b52164073f90f0de17c3b3.tar.xz
frr-ededfdb4d19be8f934b52164073f90f0de17c3b3.zip
tools: Catch more argv_find() when not checked properly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/coccinelle/argv_find.cocci7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/coccinelle/argv_find.cocci b/tools/coccinelle/argv_find.cocci
index f13b035d7..1ab19b749 100644
--- a/tools/coccinelle/argv_find.cocci
+++ b/tools/coccinelle/argv_find.cocci
@@ -4,8 +4,10 @@ identifier argv;
identifier argc;
expression e1;
expression e2;
+identifier I;
@@
+(
- argv_find(argv, argc, e1, &idx);
if (
- idx
@@ -14,3 +16,8 @@ expression e2;
{
e2;
}
+|
+- argv_find(argv, argc, e1, &idx);
+... when != I = idx;
+ when strict
+)