]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
lgtm: warn about strerror() use
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Apr 2019 13:31:34 +0000 (15:31 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Apr 2019 14:58:52 +0000 (16:58 +0200)
.lgtm/cpp-queries/PotentiallyDangerousFunction.ql

index cd0284b37a5c898f086fb28b2907f1f6f861c35c..96712cf1c67b40fd0aa82939ffb1c94664485bb6 100644 (file)
@@ -38,6 +38,9 @@ predicate potentiallyDangerousFunction(Function f, string message) {
   ) or (
     f.getQualifiedName() = "ntohs" and
     message = "Call to ntohs() is confusing. Use be16toh() instead."
+  ) or (
+    f.getQualifiedName() = "strerror" and
+    message = "Call to strerror() is not thread-safe. Use strerror_r() or printf()'s %m format string instead."
   )
 }