mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: add some missing QLDoc
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
/**
|
||||
* Provides implementation classes modeling C++ iterators, including
|
||||
* `std::iterator`, `std::iterator_traits`, and types meeting the
|
||||
* `LegacyIterator` named requirement. See `semmle.code.cpp.models.Models` for
|
||||
* usage information.
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import semmle.code.cpp.models.interfaces.Taint
|
||||
import semmle.code.cpp.models.interfaces.DataFlow
|
||||
@@ -187,6 +194,9 @@ class IteratorAssignArithmeticOperator extends Operator, DataFlowFunction, Taint
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-member `operator[]` function for an iterator type.
|
||||
*/
|
||||
class IteratorArrayOperator extends Operator, TaintFunction {
|
||||
IteratorArrayOperator() {
|
||||
this.hasName("operator[]") and
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/**
|
||||
* Provides implementation classes modeling `std::string` and other
|
||||
* instantiations of`std::basic_string`. See `semmle.code.cpp.models.Models`
|
||||
* for usage information.
|
||||
*/
|
||||
|
||||
import semmle.code.cpp.models.interfaces.Taint
|
||||
import semmle.code.cpp.models.implementations.Iterator
|
||||
|
||||
@@ -66,6 +72,9 @@ class StdStringAppend extends TaintFunction {
|
||||
getParameter(result).getType() = getDeclaringType().getTemplateArgument(0) // i.e. `std::basic_string::CharT`
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index of a parameter to this function that is an iterator.
|
||||
*/
|
||||
int getAnIteratorParameter() { getParameter(result).getType() instanceof Iterator }
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
|
||||
Reference in New Issue
Block a user