STINNER Victor added the comment:

Serhiy Storchaka:
> I think that integer overflow in _Unpickler_Read() is possible. n is read 
> from file and can be arbitrary (up to PY_SSIZE_T_MAX). This likely cause 
> raising an exception later, but integer overflow itself causes undefined 
> behavior, and we should avoid it.

Hum, I understood that it's ok since numbers should be signed, but in
fact I'm not confident that n is always signed. You are right, it's
better to use your code to avoid the integer overflow. I pushed a fix.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27056>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to