Skip to content

Commit b018040

Browse files
committed
C++/CleartextFileWrite
1 parent d89aa0f commit b018040

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ module FromSensitiveConfig implements DataFlow::ConfigSig {
3535
predicate observeDiffInformedIncrementalMode() { any() }
3636

3737
Location getASelectedSourceLocation(DataFlow::Node sourceNode) {
38-
exists(SensitiveExpr source | result = source.getLocation() | isSourceImpl(sourceNode, source))
38+
exists(SensitiveExpr source | result = [source.getLocation(), sourceNode.getLocation()] |
39+
isSourceImpl(sourceNode, source)
40+
)
3941
}
4042

4143
Location getASelectedSinkLocation(DataFlow::Node sink) {
42-
exists(FileWrite w | result = w.getLocation() | isSinkImpl(sink, w, _))
44+
exists(FileWrite w | result = [w.getLocation(), sink.getLocation()] | isSinkImpl(sink, w, _))
4345
}
4446
}
4547

0 commit comments

Comments
 (0)