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

This commit is contained in:
Lennart Poettering 2019-04-10 19:36:40 +02:00
parent 86a3d44de5
commit e2d0fa6feb
1 changed files with 3 additions and 0 deletions

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