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

Potential "Control flow issues" detected by Coverity #696

Closed
sylvestre opened this issue Jul 9, 2018 · 3 comments
Closed

Potential "Control flow issues" detected by Coverity #696

sylvestre opened this issue Jul 9, 2018 · 3 comments

Comments

@sylvestre
Copy link
Contributor

Updating to brotli 1.0.5 in Firefox, coverity discovered two new issues (CID 1437666 & 1437667)

For
https://github.com/google/brotli/blob/master/c/enc/hash_rolling_inc.h#L131
Coverity says:

dead_error_condition: The condition (position & 0UL) != 0UL cannot be true.

And for
https://github.com/google/brotli/blob/master/c/enc/hash_rolling_inc.h#L164

dead_error_condition: The condition (cur_ix & 0UL) != 0UL cannot be true.

As they do not seem to be false positive, I prefer to report them!

@eustas
Copy link
Collaborator

eustas commented Jul 9, 2018

Those are, actually, false-positives. https://scan.coverity.com/projects/google-brotli/view_defects
Coverity Scan, unfortunately, does not understand the concept of C89 templates.
Compiler will remove those pieces where they are really always-true, no need to worry about that.

@sylvestre
Copy link
Contributor Author

OK, sorry!

@eustas
Copy link
Collaborator

eustas commented Jul 9, 2018

No worries. Thanks for the heads-up!

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

No branches or pull requests

2 participants