|
|
@ -74,15 +74,15 @@ class UninitializedLocalVars(AbstractDetector): |
|
|
|
|
|
|
|
|
|
|
|
for contract in self.slither.contracts: |
|
|
|
for contract in self.slither.contracts: |
|
|
|
for function in contract.functions: |
|
|
|
for function in contract.functions: |
|
|
|
if function.is_implemented: |
|
|
|
if function.is_implemented and function.contract == contract: |
|
|
|
if function.contains_assembly: |
|
|
|
if function.contains_assembly: |
|
|
|
continue |
|
|
|
continue |
|
|
|
# dont consider storage variable, as they are detected by another detector |
|
|
|
# dont consider storage variable, as they are detected by another detector |
|
|
|
uninitialized_local_variables = [v for v in function.local_variables if not v.is_storage and v.uninitialized] |
|
|
|
uninitialized_local_variables = [v for v in function.local_variables if not v.is_storage and v.uninitialized] |
|
|
|
function.entry_point.context[self.key] = uninitialized_local_variables |
|
|
|
function.entry_point.context[self.key] = uninitialized_local_variables |
|
|
|
self._detect_uninitialized(function, function.entry_point, []) |
|
|
|
self._detect_uninitialized(function, function.entry_point, []) |
|
|
|
|
|
|
|
all_results = list(set(self.results)) |
|
|
|
for(function, uninitialized_local_variable) in self.results: |
|
|
|
for(function, uninitialized_local_variable) in all_results: |
|
|
|
var_name = uninitialized_local_variable.name |
|
|
|
var_name = uninitialized_local_variable.name |
|
|
|
|
|
|
|
|
|
|
|
info = "{} in {}.{} ({}) is a local variable never initialiazed\n" |
|
|
|
info = "{} in {}.{} ({}) is a local variable never initialiazed\n" |
|
|
|