Potential "Control flow issues" detected by Coverity #249

Closed
opened 2026-01-29 20:40:42 +00:00 by claunia · 3 comments
Owner

Originally created by @sylvestre on GitHub (Jul 9, 2018).

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!

Originally created by @sylvestre on GitHub (Jul 9, 2018). Updating to [brotli 1.0.5 in Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1474122), 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!
Author
Owner

@eustas commented on GitHub (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.

@eustas commented on GitHub (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.
Author
Owner

@sylvestre commented on GitHub (Jul 9, 2018):

OK, sorry!

@sylvestre commented on GitHub (Jul 9, 2018): OK, sorry!
Author
Owner

@eustas commented on GitHub (Jul 9, 2018):

No worries. Thanks for the heads-up!

@eustas commented on GitHub (Jul 9, 2018): No worries. Thanks for the heads-up!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#249