diwakergupta / stacks-blockchain-tob-audit

GNU General Public License v3.0
0 stars 0 forks source link

`chainstate.stacks.block.test.codec_stacks_microblock` has dead code #2

Open bradlarsen opened 4 years ago

bradlarsen commented 4 years ago

In the chainstate.stacks.block.test.codec_stacks_microblock test case, a large loop appears to be dead code, since it is using the length of an empty vector as its loop condition:

https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/block.rs#L1063

The code block just above this appears to drain the vector entirely.

Code coverage from CI corroborates.

jcnelson commented 4 years ago

Thanks! Will fix this.