mirror of
https://github.com/github/codeql.git
synced 2026-07-06 12:05:31 +02:00
20 lines
564 B
Plaintext
20 lines
564 B
Plaintext
/**
|
|
* @name Dereferenced variable is always null
|
|
* @description Dereferencing a variable whose value is 'null' causes a 'NullReferenceException'.
|
|
* @kind problem
|
|
* @problem.severity error
|
|
* @precision very-high
|
|
* @id cs/dereferenced-value-is-always-null
|
|
* @tags reliability
|
|
* correctness
|
|
* exceptions
|
|
* external/cwe/cwe-476
|
|
*/
|
|
|
|
import csharp
|
|
import semmle.code.csharp.dataflow.Nullness
|
|
|
|
from Dereference d, Ssa::SourceVariable v
|
|
where d.isFirstAlwaysNull(v)
|
|
select d, "Variable $@ is always null at this dereference.", v, v.toString()
|