Browse Source

lgtm: complain about accept() [people should use accept4() instead, due to O_CLOEXEC]

master
Lennart Poettering 3 years ago
parent
commit
e2d0fa6feb
  1. 3
      .lgtm/cpp-queries/PotentiallyDangerousFunction.ql

3
.lgtm/cpp-queries/PotentiallyDangerousFunction.ql

@ -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."
)
}

Loading…
Cancel
Save