Message303310
The problem is with the following check:
n = digits * bits_per_char + PyLong_SHIFT - 1;
if (n / bits_per_char < p - start) {
PyErr_SetString(PyExc_ValueError,
"int string too large to convert");
The problem is that n / bits_per_char gives the number of digits required. But p - start has the number of '_'s included in it. So even for valid cases, if the number of '_'s is above a limit, this check holds true and an overflow is raised.
Fix: Replace p - start with the actual number of digits. |
|
Date |
User |
Action |
Args |
2017-09-29 08:28:48 | nitishch | set | recipients:
+ nitishch, georg.brandl, mark.dickinson, serhiy.storchaka |
2017-09-29 08:28:48 | nitishch | set | messageid: <1506673728.12.0.213398074469.issue31619@psf.upfronthosting.co.za> |
2017-09-29 08:28:48 | nitishch | link | issue31619 messages |
2017-09-29 08:28:47 | nitishch | create | |
|