mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
CPP: Autoformat 'Critical'.
This commit is contained in:
@@ -8,16 +8,22 @@
|
||||
* security
|
||||
* external/cwe/cwe-476
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
from LocalScopeVariable v, ControlFlowNode def,
|
||||
VariableAccess checked, VariableAccess unchecked
|
||||
where checked = v.getAnAccess() and dereferenced(checked)
|
||||
and unchecked = v.getAnAccess() and dereferenced(unchecked)
|
||||
and definitionUsePair(v, def, checked)
|
||||
and definitionUsePair(v, def, unchecked)
|
||||
and checkedValid(v, checked)
|
||||
and not(checkedValid(v, unchecked))
|
||||
and not(unchecked.getParent+() instanceof SizeofOperator)
|
||||
and forall(ControlFlowNode other | definitionUsePair(v, other, checked) | definitionUsePair(v, other, unchecked))
|
||||
select unchecked, "This dereference is not guarded by a non-null check, whereas other dereferences are guarded"
|
||||
from LocalScopeVariable v, ControlFlowNode def, VariableAccess checked, VariableAccess unchecked
|
||||
where
|
||||
checked = v.getAnAccess() and
|
||||
dereferenced(checked) and
|
||||
unchecked = v.getAnAccess() and
|
||||
dereferenced(unchecked) and
|
||||
definitionUsePair(v, def, checked) and
|
||||
definitionUsePair(v, def, unchecked) and
|
||||
checkedValid(v, checked) and
|
||||
not checkedValid(v, unchecked) and
|
||||
not unchecked.getParent+() instanceof SizeofOperator and
|
||||
forall(ControlFlowNode other | definitionUsePair(v, other, checked) |
|
||||
definitionUsePair(v, other, unchecked)
|
||||
)
|
||||
select unchecked,
|
||||
"This dereference is not guarded by a non-null check, whereas other dereferences are guarded"
|
||||
|
||||
Reference in New Issue
Block a user