Message209368
| Author |
christian.heimes |
| Recipients |
christian.heimes, serhiy.storchaka, terry.reedy |
| Date |
2014年01月26日.23:45:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1390779959.83.0.901638495575.issue20394@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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; |
|
History
|
|---|
| 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 |
|