Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assigned value is garbage #986

Closed
fbthrift opened this issue May 29, 2018 · 5 comments
Closed

assigned value is garbage #986

fbthrift opened this issue May 29, 2018 · 5 comments

Comments

@fbthrift
Copy link

/libraries/fc/src/compress/smaz.cpp line 150:

flush[1] = verb[0]; //verb[0] is not initialization

in line 88:char verb[256], *_out = out; // verb[256] is defined here but not initialization

and in line 125: goto out: but verb[256] is also not initialization

@abitmore
Copy link
Member

Thanks for the report.

I think this is not being used in core, so perhaps we can simply remove it.

@abitmore abitmore added this to the 201807 - Next Non-Consensus-Changing Release milestone May 29, 2018
@pmconrad pmconrad self-assigned this May 29, 2018
@pmconrad
Copy link
Contributor

I believe the report is wrong. When line 125 is hit, we either have verblen == 0 AND flush == NULL, or verblen > 0 AND flush != NULL (from assignment in line 114). verblen > 0 can only happen if line 133 has been hit at least once, which implies that verb[0] has been initialized in line 132. OTOH, if verblen == 0 then flush == NULL, which means line 150 will not be hit.

Nevertheless, the code looks rather dirty and is in fact not used in the core. I think removing it would be OK.

@pmconrad
Copy link
Contributor

Resolved via bitshares/bitshares-fc#51

@abitmore
Copy link
Member

Just a note: still need to bump FC.

@pmconrad
Copy link
Contributor

not really - can wait until next bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants