mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
16 lines
277 B
C#
16 lines
277 B
C#
using System;
|
|
|
|
class Bad
|
|
{
|
|
void DoPrint(object o)
|
|
{
|
|
Console.WriteLine(o.ToString()); // $ Alert[cs/dereferenced-value-may-be-null]
|
|
}
|
|
|
|
void M()
|
|
{
|
|
DoPrint("Hello");
|
|
DoPrint(null); // $ Source[cs/dereferenced-value-may-be-null]
|
|
}
|
|
}
|