Antoine Pitrou <[email protected]> added the comment:
> I don't know if "nallocated += repsize - 4;" can overflow or not.
> If yes, how can I detect the overflow?
Sure, if they are both Py_ssize_t, just use:
if (nallocated > PY_SSIZE_T_MAX - repsize + 4) {
/* handle overflow ... */
}
----------
nosy: +pitrou
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com