mirror of
https://github.com/github/codeql.git
synced 2026-04-14 11:34:00 +02:00
22 lines
654 B
Plaintext
22 lines
654 B
Plaintext
/**
|
|
* @name Dereferenced variable may be null
|
|
* @description Dereferencing a variable whose value may be 'null' may cause a
|
|
* 'NullReferenceException'.
|
|
* @kind problem
|
|
* @problem.severity warning
|
|
* @precision high
|
|
* @id cs/dereferenced-value-may-be-null
|
|
* @tags quality
|
|
* reliability
|
|
* correctness
|
|
* exceptions
|
|
* external/cwe/cwe-476
|
|
*/
|
|
|
|
import csharp
|
|
import semmle.code.csharp.dataflow.Nullness
|
|
|
|
from Dereference d, Ssa::SourceVariable v, string msg, Element reason
|
|
where maybeNullDeref(d, v, msg, reason)
|
|
select d, "Variable $@ may be null at this access " + msg + ".", v, v.toString(), reason, "this"
|