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

0.8.1: PVS Studio flagged buffer underflows in the state reset functions #625

Closed
kcgen opened this issue Nov 30, 2021 · 0 comments · Fixed by #638
Closed

0.8.1: PVS Studio flagged buffer underflows in the state reset functions #625

kcgen opened this issue Nov 30, 2021 · 0 comments · Fixed by #638

Comments

@kcgen
Copy link
Contributor

kcgen commented Nov 30, 2021

2021-11-30_10-07
2021-11-30_10-08

My guess is it's detecting the use of the reserved portion, which if coming from malloc (for the memory behind the incoming state pointer), might contain garbage.

Cyan4973 added a commit that referenced this issue Dec 1, 2021
PVS Studio static analyzer doesn't like that the structure is not entirely initialized.
This was supposed to allow, in some future, to reduce the size of the state,
while minimizing impact with library's installed based (in case of version mismatch).

This is way too complex and risky for such a tiny benefit.
So revert to the classical "init everything" method, which should please PVS Studio.
The last member will remain "reserved" and unused.
Who knows, maybe in some future, it may be of some use, for some purpose yet to determine.
@Cyan4973 Cyan4973 mentioned this issue Dec 1, 2021
Cyan4973 added a commit that referenced this issue Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant