This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients christian.heimes, eric.smith, jkloth, mark.dickinson, vstinner, zach.ware
Date 2013-11-23.20:08:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385237304.01.0.383466952555.issue19638@psf.upfronthosting.co.za>
In-reply-to
Content
Christian:  I don't think this code is safe:

-    nd0 = nd = s - s1;
+    tmp = s - s1;
+    nd0 = nd = Py_SAFE_DOWNCAST(tmp, Py_SSIZE_T, int);

The result of the Py_SAFE_DOWNCAST could be almost anything, and in particular could be negative.  It would take a careful examination of the code to guarantee that a negative nd or nd0 won't lead to difficulties further down the algorithm.  I think we need to raise an error if tmp is too large, *before* the downcast.
History
Date User Action Args
2013-11-23 20:08:24mark.dickinsonsetrecipients: + mark.dickinson, vstinner, eric.smith, christian.heimes, jkloth, zach.ware
2013-11-23 20:08:24mark.dickinsonsetmessageid: <1385237304.01.0.383466952555.issue19638@psf.upfronthosting.co.za>
2013-11-23 20:08:24mark.dickinsonlinkissue19638 messages
2013-11-23 20:08:23mark.dickinsoncreate