Skip to content

Commit b73dc98

Browse files
committed
C++: Exclude write to stdout etc.
1 parent b3f4357 commit b73dc98

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/ql/src/Security/CWE/CWE-311/CleartextFileWrite.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ where
6565
midNode.getNode().asExpr() = mid and
6666
mid = w.getASource() and
6767
dest = w.getDest() and
68+
not dest.(VariableAccess).getTarget().getName() = ["stdin", "stdout", "stderr"] and // exclude calls with standard streams
6869
not isFileName(globalValueNumber(source)) and // file names are not passwords
6970
not exists(string convChar | convChar = w.getSourceConvChar(mid) | not convChar = ["s", "S"]) // ignore things written with other conversion characters
7071
select w, sourceNode, midNode,

0 commit comments

Comments
 (0)