crytic / crytic/slither

Tracking: imprecision of data dependencies on structures and arrays

Open
#365 3 comments 0 reactions 0 assignees View on GitHub
bug enhancement tracking
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

```bash

echo "pragma solidity ^0.5.3;

contract C {
struct S { uint x; }

function x() external pure returns (address) {
S memory s;
s.x = 1;
}
}" > a.sol && slither a.sol

INFO:Detectors:
s in C.x() (a.sol#7) is a local variable never initialiazed
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-local-variables
INFO:Slither:a.sol analyzed (1 contracts with 38 detectors), 1 result(s) found
```

Returns that `s` is never initialized, when in fact we populate all of its fields in the following line
Related to https://github.com/crytic/slither/issues/270 and https://github.com/crytic/slither/issues/112 probably

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.