Skip to content

Commit e2d0fa6

Browse files
committed
lgtm: complain about accept() [people should use accept4() instead, due to O_CLOEXEC]
1 parent 86a3d44 commit e2d0fa6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.lgtm/cpp-queries/PotentiallyDangerousFunction.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ predicate potentiallyDangerousFunction(Function f, string message) {
4141
) or (
4242
f.getQualifiedName() = "strerror" and
4343
message = "Call to strerror() is not thread-safe. Use strerror_r() or printf()'s %m format string instead."
44+
) or (
45+
f.getQualifiedName() = "accept" and
46+
message = "Call to accept() is not O_CLOEXEC-safe. Use accept4() instead."
4447
)
4548
}
4649

0 commit comments

Comments
 (0)