Message60078
| Author | gvanrossum |
|---|---|
| Recipients | alexandre.vassalotti, christian.heimes, donmez, gregory.p.smith, gvanrossum, loewis |
| Date | 2008-01-18.01:22:43 |
| SpamBayes Score | 0.0021405313 |
| Marked as misclassified | No |
| Message-id | <1200619364.74.0.438903510257.issue1621@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
I think the -Wstrict-overflow option may not be enough for the audit we
need.
The overflow issue in expandtabs() still exists (in 2.5 as well as in
the trunk):
if (*p == '\n' || *p == '\r') {
i += j;
old_j = j = 0;
if (i < 0) {
PyErr_SetString(PyExc_OverflowError,
"new string is too long");
return NULL;
}
}
Here i and j are signed ints (Py_ssize_t) initially know to be >= 0; i
can only become < 0 through overflow. This is the place where Ismail
(cartman) found a crash because the test was optimized away by GCC 4.3
before we added -fwrap.
If we ever hope to clean up the code to the point where -fwrapv is no
longer needed, the audit should find this spot! (Good thing we at least
had a unittest for the overflow check. This should be standard practice
for all overflow checks, as long it doesn't require allocating a GB or
more of memory.) |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008-01-18 01:22:45 | gvanrossum | set | spambayes_score: 0.00214053 -> 0.0021405313 recipients: + gvanrossum, loewis, gregory.p.smith, christian.heimes, alexandre.vassalotti, donmez |
| 2008-01-18 01:22:44 | gvanrossum | set | spambayes_score: 0.00214053 -> 0.00214053 messageid: <1200619364.74.0.438903510257.issue1621@psf.upfronthosting.co.za> |
| 2008-01-18 01:22:43 | gvanrossum | link | issue1621 messages |
| 2008-01-18 01:22:43 | gvanrossum | create | |