Query module UninitializedLocal

name
Potentially uninitialized local variable
description
Reading from a local variable that has not been assigned to will typically yield garbage.
kind
problem
id
cpp/uninitialized-local
problem.severity
warning
precision
medium
tags
security external/cwe/cwe-665 external/cwe/cwe-457

Imports

LocalScopeVariableReachability
cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Predicates

allocatedType

Auxiliary predicate: Types that don’t require initialization before they are used, since they’re stack-allocated.

commonException

Auxiliary predicate: List common exceptions or false positives for this check to exclude them.

containsInlineAssembly
declWithNoInit

A declaration of a local variable that leaves the variable uninitialized.

Classes