mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
C++: Fix false positives around terminal output.
This commit is contained in:
@@ -16,6 +16,7 @@ import semmle.code.cpp.security.SensitiveExprs
|
||||
import semmle.code.cpp.dataflow.TaintTracking
|
||||
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
|
||||
import semmle.code.cpp.models.interfaces.FlowSource
|
||||
import semmle.code.cpp.commons.File
|
||||
import DataFlow::PathGraph
|
||||
|
||||
/**
|
||||
@@ -143,6 +144,13 @@ abstract class NetworkSendRecv extends FunctionCall {
|
||||
v.getTarget().getName() = ["stdin", "stdout", "stderr"] and
|
||||
g = globalValueNumber(v)
|
||||
)
|
||||
or
|
||||
// open of `"/dev/tty"`
|
||||
exists(FunctionCall fc |
|
||||
fopenCall(fc) and
|
||||
fc.getAnArgument().getValue() = "/dev/tty" and
|
||||
g = globalValueNumber(fc)
|
||||
)
|
||||
// (this is not exhaustive)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user