Skip to content

Commit 84c83f4

Browse files
committed
C++: Search both specified and unspecified type for iterators to not break Coding Standards.
1 parent 7a2b170 commit 84c83f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/StdString.qll

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ abstract private class StdStringTaintFunction extends TaintFunction {
6666
* Gets the index of a parameter to this function that is an iterator.
6767
*/
6868
final int getAnIteratorParameterIndex() {
69-
this.getParameter(result).getUnspecifiedType() instanceof Iterator
69+
exists(Parameter p |
70+
p = this.getParameter(result) and
71+
[p.getType(), p.getUnspecifiedType()] instanceof Iterator
72+
)
7073
}
7174
}
7275

0 commit comments

Comments
 (0)