Fix a minor bug in banned API check script
Avoid false positives due to partial match of new APIs with the
banned libc APIs.
Ex: A patch which introduced support for strtok_r() failed static
checks because of match with strtok() banned API
Also updated the coverity exclusion file as no platform uses the
libc strtok_r function.
Change-Id: I59ed31ac952d152561fd75e8c928057780503976
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/script/static-checks/check-banned-api.py b/script/static-checks/check-banned-api.py
index 0bfadeb..3b0cdcd 100755
--- a/script/static-checks/check-banned-api.py
+++ b/script/static-checks/check-banned-api.py
@@ -29,7 +29,7 @@
BANNED_APIS = ["strcpy", "wcscpy", "strncpy", "strcat", "wcscat", "strncat",
"sprintf", "vsprintf", "strtok", "atoi", "atol", "atoll",
"itoa", "ltoa", "lltoa"]
-BANNED_PATTERN = re.compile('|'.join(BANNED_APIS))
+BANNED_PATTERN = re.compile('\(|'.join(BANNED_APIS))
COMMENTS_PATTERN = re.compile(r"//|/\*|\*/")
diff --git a/script/tf-coverity/coverity_tf_conf.py b/script/tf-coverity/coverity_tf_conf.py
index 392ad4a..9e26532 100644
--- a/script/tf-coverity/coverity_tf_conf.py
+++ b/script/tf-coverity/coverity_tf_conf.py
@@ -53,6 +53,7 @@
("lib/compiler-rt/.*", "3rd party libraries will not be fixed"),
("lib/libfdt/.*", "3rd party libraries will not be fixed"),
("lib/libc/strlcat.c", "Not used by any upstream platform"),
+ ("lib/libc/strtok.c", "Not used by any upstream platform"),
("tools/.*", "Host tools"),
]