Martin v. Löwis <[email protected]> added the comment:
> MvL> If you are absolutely certain that a cast cannot possibly truncate,
> MvL> add a comment explaining why that is.
>
> Ah yes, sorry, I forgot to add a comment: done in r87746.
But the comment is actually wrong: It says
len <= buf_size <= INT_MAX (see above)
however, len > buf_size may happen, after this code:
if (len > buf_size) {
PyErr_Format(PyExc_ValueError,
"read() returned too much data: "
"%i bytes requested, %zd returned",
buf_size, len);
goto finally;
}
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9566>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com