]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed integer overflow in array.buffer_info().
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 23 Jun 2016 20:55:34 +0000 (23:55 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 23 Jun 2016 20:55:34 +0000 (23:55 +0300)
Modules/arraymodule.c

index f73c5993658593e51ddab1f596f8c90bf8043e7a..28031770a5897a9a52b5ba4c38db8b1e32a82f1e 100644 (file)
@@ -1268,7 +1268,7 @@ array_array_buffer_info_impl(arrayobject *self)
     }
     PyTuple_SET_ITEM(retval, 0, v);
 
-    v = PyLong_FromLong((long)(Py_SIZE(self)));
+    v = PyLong_FromSsize_t(Py_SIZE(self));
     if (v == NULL) {
         Py_DECREF(retval);
         return NULL;