Files
codeql/cpp/ql/src/Critical/MissingNullTest.ql
2019-04-23 14:45:27 +01:00

19 lines
486 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
* @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."