Author xtreak
Recipients eric.smith, mark.dickinson, serhiy.storchaka, vstinner, xtreak
Date 2018-12-22.18:21:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545502884.66.0.0770528567349.issue35560@roundup.psfhosted.org>
In-reply-to
Content
> min_width сan be large negative number, and there are subtractions from it. It may be safer to replace the assert with something like min_width = Py_MAX(0, min_width). Or ensure that it is non-negative before calling _PyUnicode_InsertThousandsGrouping()

Looking at the code the loop seems to operate on the assumption that min_width is >= 0 in the beginning with the assert statement until both remaining and min_width are negative to break out of the loop. Applying Py_MAX(0, min_width) causes no test failures but maybe I have missed adding a case where large negative min_width might have triggered other issue.
History
Date User Action Args
2018-12-22 18:21:25xtreaksetrecipients: + xtreak, mark.dickinson, vstinner, eric.smith, serhiy.storchaka
2018-12-22 18:21:24xtreaksetmessageid: <1545502884.66.0.0770528567349.issue35560@roundup.psfhosted.org>
2018-12-22 18:21:24xtreaklinkissue35560 messages
2018-12-22 18:21:24xtreakcreate