C++: Fix Code Scanning errors.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-06-19 19:17:01 +01:00
parent 3e9862391b
commit f507b51170
2 changed files with 2 additions and 33 deletions

View File

@@ -197,7 +197,7 @@ private predicate summaryModel0(
}
/**
* Holds if `input` is `input0`, but with all occurences of `@` replaced
* Holds if `input` is `input0`, but with all occurrences of `@` replaced
* by `n` repetitions of `*` (and similarly for `output` and `output0`).
*/
bindingset[input0, output0, n]
@@ -701,7 +701,7 @@ private predicate hasClassAndName(Class classWithMethod, Function method, string
}
/**
* Holds if `nameClass` is in namespace `namespace` and has
* Holds if `namedClass` is in namespace `namespace` and has
* name `type` (excluding any template parameters).
*/
bindingset[type, namespace]

View File

@@ -55,37 +55,6 @@ private class Vector extends StdSequenceContainer {
Vector() { this.hasQualifiedName(["std", "bsl"], "vector") }
}
/**
* Additional model for standard container constructors that reference the
* value type of the container (that is, the `T` in `std::vector<T>`). For
* example the fill constructor:
* ```
* std::vector<std::string> v(100, potentially_tainted_string);
* ```
*/
private class StdSequenceContainerConstructor extends Constructor {
StdSequenceContainerConstructor() {
this.getDeclaringType() instanceof Vector or
this.getDeclaringType() instanceof Deque or
this.getDeclaringType() instanceof List or
this.getDeclaringType() instanceof ForwardList
}
/**
* Gets the index of a parameter to this function that is a reference to the
* value type of the container.
*/
int getAValueTypeParameterIndex() {
this.getParameter(result).getUnspecifiedType().(ReferenceType).getBaseType() =
this.getDeclaringType().getTemplateArgument(0).(Type).getUnspecifiedType() // i.e. the `T` of this `std::vector<T>`
}
/**
* Gets the index of a parameter to this function that is an iterator.
*/
int getAnIteratorParameterIndex() { this.getParameter(result).getType() instanceof Iterator }
}
/**
* The standard container functions `push_back` and `push_front`.
*/