Merge pull request #6794 from geoffw0/impropnullfp

C++: Improvements to cpp/improper-null-termination
This commit is contained in:
Mathias Vorreiter Pedersen
2021-10-12 14:47:02 +01:00
committed by GitHub
7 changed files with 116 additions and 32 deletions

View File

@@ -5,6 +5,7 @@
* @kind problem
* @id cpp/improper-null-termination
* @problem.severity warning
* @precision medium
* @security-severity 7.8
* @tags security
* external/cwe/cwe-170
@@ -53,6 +54,7 @@ class ImproperNullTerminationReachability extends StackVariableReachabilityWithR
override predicate isBarrier(ControlFlowNode node, StackVariable v) {
exprDefinition(v, node, _) or
mayAddNullTerminator(node, v.getAnAccess()) or
node.(AddressOfExpr).getOperand() = v.getAnAccess() or // address taken
isSinkActual(node, v) // only report first use
}
}

View File

@@ -5,6 +5,7 @@
* @kind problem
* @id cpp/user-controlled-null-termination-tainted
* @problem.severity warning
* @precision medium
* @security-severity 10.0
* @tags security
* external/cwe/cwe-170