Files
codeql/cpp/ql/src/Critical/MissingNullTest.ql
2021-06-15 13:25:17 +01:00

20 lines
512 B
Plaintext

/**
* @name Returned pointer not checked
* @description Dereferencing an untested value from a function that can return null may lead to undefined behavior.
* @kind problem
* @id cpp/missing-null-test
* @problem.severity recommendation
* @security-severity 7.5
* @tags reliability
* security
* external/cwe/cwe-476
*/
import cpp
from VariableAccess access
where
maybeNull(access) and
dereferenced(access)
select access, "Value may be null; it should be checked before dereferencing."