QL code and tests for C#/C++/JavaScript.

This commit is contained in:
Pavel Avgustinov
2018-08-02 17:53:23 +01:00
commit b55526aa58
10684 changed files with 581163 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/**
* @name Returned pointer not checked
* @description A value returned from a function that may return null is not tested to determine whether or not it is null. Dereferencing NULL pointers lead to undefined behavior.
* @kind problem
* @id cpp/missing-null-test
* @problem.severity recommendation
* @tags reliability
* 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."