Message209368
Coverity is concerned about the value of `q` when `len < 0`. The expression
Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
returns a positive, non-null value for len > 0. Another check ensures that len != 0 a couple of lines earlier. In theory it is possible that len < 0. After all it's a signed integer type.
Coverity tries very hard to guess the intention of code. Because there is a check for len > 0, Coverity thinks that the code has to handle len < 0. IMO a good fix should check len >= 0 very early and replace that line with
Py_ssize_t q = 1 + (len - 1) / inrate; |
|
Date |
User |
Action |
Args |
2014-01-26 23:45:59 | christian.heimes | set | recipients:
+ christian.heimes, terry.reedy, serhiy.storchaka |
2014-01-26 23:45:59 | christian.heimes | set | messageid: <1390779959.83.0.901638495575.issue20394@psf.upfronthosting.co.za> |
2014-01-26 23:45:59 | christian.heimes | link | issue20394 messages |
2014-01-26 23:45:59 | christian.heimes | create | |
|