Skip to content

Commit c94973a

Browse files
committed
C++: IteratorToExpiredContainer
1 parent f1408de commit c94973a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,14 @@ module Config implements DataFlow::StateConfigSig {
150150
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 154 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql@157:8:157:10)
151151
}
152152

153-
Location getASelectedSourceLocation(DataFlow::Node source) {
154-
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 154 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql@157:8:157:10)
155-
}
153+
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
156154

157155
Location getASelectedSinkLocation(DataFlow::Node sink) {
158-
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 154 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql@157:8:157:10)
156+
exists(DataFlow::Node mid, FlowState state | result = mid.getLocation() |
157+
destroyedToBeginSink(sink) and
158+
isSink(sink, state) and
159+
state = Config::DestroyedToBegin(mid)
160+
)
159161
}
160162
}
161163

0 commit comments

Comments
 (0)