]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
lgtm: complain about accept() [people should use accept4() instead, due to O_CLOEXEC]
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Apr 2019 17:36:40 +0000 (19:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Apr 2019 18:03:38 +0000 (20:03 +0200)
.lgtm/cpp-queries/PotentiallyDangerousFunction.ql

index 96712cf1c67b40fd0aa82939ffb1c94664485bb6..865330430d9c8ad5bd3f3cc2ad1a027c3db298c7 100644 (file)
@@ -41,6 +41,9 @@ predicate potentiallyDangerousFunction(Function f, string message) {
   ) or (
     f.getQualifiedName() = "strerror" and
     message = "Call to strerror() is not thread-safe. Use strerror_r() or printf()'s %m format string instead."
+  ) or (
+    f.getQualifiedName() = "accept" and
+    message = "Call to accept() is not O_CLOEXEC-safe. Use accept4() instead."
   )
 }