Coverity check please...

Hal Murray halmurray at sonic.net
Sun Jan 19 08:32:01 UTC 2025


I think it's a bug in Coverity.  Would somebody please check.

Is there a way to report bugs to Coverity?  Or tell it not to check 
something?



It's getting here with n =2
 11. known_value_assign: j = n, its value is now 2.
471        i = 0; j = n;
472        m = n - (n * 4) / 10;
(n*4)/10 is 0, so m is 2
      12. Condition j - i > m, taking true branch.
      16. Condition j - i > m, taking true branch.
      20. Condition j - i > m, taking true branch.
     
CID 497295: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
24. overflow_const: Expression j - i, where j is known to be equal to 2, 
and i is known to be equal to 3, underflows the type of j - i, which is 
type unsigned long.
(j-1) is 2, m is 2, so it never goes around the loop.
473        while ((j - i) > m) {
474                offset = off[(j + i) / 2];
      13. Condition off[j - 1] - offset < offset - off[i], taking true 
branch.


We currently have two bugs.  This is the top one.  I think I've got a fix 
for the second.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list