Message135764
| Author |
vstinner |
| Recipients |
benjamin.peterson, daniel.urban, jcon, nirai, pitrou, stutzbach, vstinner |
| Date |
2011年05月11日.08:51:40 |
| SpamBayes Score |
1.0335877e-05 |
| Marked as misclassified |
No |
| Message-id |
<1305103893.14362.4.camel@marge> |
| In-reply-to |
<1305054390.14.0.664085358478.issue9971@psf.upfronthosting.co.za> |
| Content |
Le mardi 10 mai 2011 à 19:06 +0000, John O'Connor a écrit :
> Victor: AFAIK its not actually downcasting.
On Linux 32 bits, size_t is 32 bits, off_t is 64 bits. If the file size
is 4 GB, the downcast may truncate the size of 0 byte. It would be safer
to use off_t type for the n variable in buffered_readinto(), and maybe
cast to size_t on the call to memcpy. At memcpy, it is safe because the
maximum possible value of n is PY_SSIZE_T (2^31-1 on a 32 bits system),
which fit in a size_t. |
|