Skip to content

Commit 15f09e8

Browse files
committed
C++: Work around problems I can't seem to solve for access paths at sources and sinks.
1 parent c2f7bf1 commit 15f09e8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,10 @@ private module Cached {
953953
*/
954954
cached
955955
predicate sourceNode(DataFlow::Node node, string kind, string model) {
956+
exists(SourceSinkInterpretationInput::InterpretNode n |
957+
isSourceNode(n, kind, model) and n.asNode() = node
958+
)
959+
or
956960
node.(Nodes::FlowSummaryNode).isSource(kind, model)
957961
}
958962

cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ private class SourceModelCall extends Public::SourceElement instanceof Call {
376376
private string ext;
377377

378378
SourceModelCall() {
379-
sourceModel(namespace, type, subtypes, name, signature, ext, _, _, _, _) and
379+
exists(string output |
380+
sourceModel(namespace, type, subtypes, name, signature, ext, output, _, _, _) and
381+
output.matches("%" + Input::encodeContent(_, _) + "%")
382+
) and
380383
this.getTarget() = interpretElement(namespace, type, subtypes, name, signature, ext)
381384
}
382385

0 commit comments

Comments
 (0)