Hello community, here is the log from the commit of package python for openSUSE:Factory checked in at 2016-02-28 02:26:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python (Old) and /work/SRC/openSUSE:Factory/.python.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python" Changes: -------- --- /work/SRC/openSUSE:Factory/python/python-base.changes 2015-09-19 06:52:48.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python.new/python-base.changes 2016-02-28 02:26:13.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Jan 29 13:03:40 UTC 2016 - [email protected] + +- Add python-2.7.10-overflow_check.patch to fix broken overflow checks. + [bnc#964182] + +------------------------------------------------------------------- python.changes: same change New: ---- python-2.7.10-overflow_check.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-base.spec ++++++ --- /var/tmp/diff_new_pack.16JCKS/_old 2016-02-28 02:26:16.000000000 +0100 +++ /var/tmp/diff_new_pack.16JCKS/_new 2016-02-28 02:26:16.000000000 +0100 @@ -56,6 +56,7 @@ Patch34: python-2.7.9-sles-disable-verification-by-default.patch # PATCH-FIX-UPSTREAM python-ncurses-6.0-accessors.patch [email protected] -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 Patch35: python-ncurses-6.0-accessors.patch +Patch36: python-2.7.10-overflow_check.patch # COMMON-PATCH-END %define python_version %(echo %{tarversion} | head -c 3) BuildRequires: automake @@ -149,6 +150,7 @@ %patch34 -p1 %endif %patch35 -p1 +%patch36 # drop Autoconf version requirement sed -i 's/^version_required/dnl version_required/' configure.ac ++++++ python-doc.spec ++++++ --- /var/tmp/diff_new_pack.16JCKS/_old 2016-02-28 02:26:16.000000000 +0100 +++ /var/tmp/diff_new_pack.16JCKS/_new 2016-02-28 02:26:16.000000000 +0100 @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: python-doc Version: 2.7.10 Release: 0 @@ -57,6 +56,7 @@ Patch34: python-2.7.9-sles-disable-verification-by-default.patch # PATCH-FIX-UPSTREAM python-ncurses-6.0-accessors.patch [email protected] -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 Patch35: python-ncurses-6.0-accessors.patch +Patch36: python-2.7.10-overflow_check.patch # COMMON-PATCH-END Provides: pyth_doc Provides: pyth_ps @@ -104,6 +104,7 @@ %patch34 -p1 %endif %patch35 -p1 +%patch36 # drop Autoconf version requirement sed -i 's/^version_required/dnl version_required/' configure.ac ++++++ python.spec ++++++ --- /var/tmp/diff_new_pack.16JCKS/_old 2016-02-28 02:26:16.000000000 +0100 +++ /var/tmp/diff_new_pack.16JCKS/_new 2016-02-28 02:26:16.000000000 +0100 @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: python Version: 2.7.10 Release: 0 @@ -62,6 +61,7 @@ Patch34: python-2.7.9-sles-disable-verification-by-default.patch # PATCH-FIX-UPSTREAM python-ncurses-6.0-accessors.patch [email protected] -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1 Patch35: python-ncurses-6.0-accessors.patch +Patch36: python-2.7.10-overflow_check.patch # COMMON-PATCH-END BuildRequires: automake BuildRequires: db-devel @@ -205,6 +205,7 @@ %patch34 -p1 %endif %patch35 -p1 +%patch36 # drop Autoconf version requirement sed -i 's/^version_required/dnl version_required/' configure.ac ++++++ python-2.7.10-overflow_check.patch ++++++ --- ./Objects/bytearrayobject.c.orig 2016-01-29 13:58:55.414941897 +0100 +++ ./Objects/bytearrayobject.c 2016-01-29 14:00:18.383902058 +0100 @@ -1903,12 +1903,12 @@ /* Check for overflow */ /* result_len = self_len + count * (to_len-from_len) */ - product = count * (to_len-from_len); + product = (size_t)count * (to_len-from_len); if (product / (to_len-from_len) != count) { PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); return NULL; } - result_len = self_len + product; + result_len = (size_t)self_len + product; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); return NULL; --- ./Objects/stringobject.c.orig 2016-01-29 14:00:30.904046945 +0100 +++ ./Objects/stringobject.c 2016-01-29 14:01:14.120547063 +0100 @@ -2693,12 +2693,12 @@ /* Check for overflow */ /* result_len = self_len + count * (to_len-from_len) */ - product = count * (to_len-from_len); + product = (size_t)count * (to_len-from_len); if (product / (to_len-from_len) != count) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - result_len = self_len + product; + result_len = (size_t)self_len + product; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; --- Objects/bytearrayobject.c.orig 2016-01-29 14:14:36.713834152 +0100 +++ Objects/bytearrayobject.c 2016-01-29 14:17:50.880080712 +0100 @@ -357,7 +357,7 @@ if (count < 0) count = 0; mysize = Py_SIZE(self); - size = mysize * count; + size = (size_t)mysize * count; if (count != 0 && size / count != mysize) return PyErr_NoMemory(); result = (PyByteArrayObject *)PyByteArray_FromStringAndSize(NULL, size); @@ -382,7 +382,7 @@ if (count < 0) count = 0; mysize = Py_SIZE(self); - size = mysize * count; + size = (size_t)mysize * count; if (count != 0 && size / count != mysize) return PyErr_NoMemory(); if (size < self->ob_alloc) { @@ -1578,13 +1578,13 @@ /* Check for overflow */ /* result_len = count * to_len + self_len; */ - product = count * to_len; + product = (size_t)count * to_len; if (product / to_len != count) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - result_len = product + self_len; + result_len = (size_t)product + self_len; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); @@ -1833,12 +1833,12 @@ /* use the difference between current and new, hence the "-1" */ /* result_len = self_len + count * (to_len-1) */ - product = count * (to_len-1); + product = (size_t)count * (to_len-1); if (product / (to_len-1) != count) { PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); return NULL; } - result_len = self_len + product; + result_len = (size_t)self_len + product; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); return NULL; --- ./Objects/stringobject.c.orig 2016-01-29 14:18:21.392433741 +0100 +++ ./Objects/stringobject.c 2016-01-29 14:20:23.669848479 +0100 @@ -1084,7 +1084,7 @@ /* watch out for overflows: the size can overflow int, * and the # of bytes needed can overflow size_t */ - size = Py_SIZE(a) * n; + size = (size_t)Py_SIZE(a) * n; if (n && size / n != Py_SIZE(a)) { PyErr_SetString(PyExc_OverflowError, "repeated string is too long"); @@ -1644,9 +1644,9 @@ Py_DECREF(seq); return NULL; } - sz += PyString_GET_SIZE(item); + sz += (size_t)PyString_GET_SIZE(item); if (i != 0) - sz += seplen; + sz += (size_t)seplen; if (sz < old_sz || sz > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); @@ -2370,13 +2370,13 @@ /* Check for overflow */ /* result_len = count * to_len + self_len; */ - product = count * to_len; + product = (size_t)count * to_len; if (product / to_len != count) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - result_len = product + self_len; + result_len = (size_t)product + self_len; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); @@ -2624,12 +2624,12 @@ /* use the difference between current and new, hence the "-1" */ /* result_len = self_len + count * (to_len-1) */ - product = count * (to_len-1); + product = (size_t)count * (to_len-1); if (product / (to_len-1) != count) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - result_len = self_len + product; + result_len = (size_t)self_len + product; if (result_len < 0) { PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; --- Objects/tupleobject.c.orig 2016-01-29 14:38:23.334287970 +0100 +++ Objects/tupleobject.c 2016-01-29 14:39:46.175240404 +0100 @@ -79,7 +79,7 @@ else #endif { - Py_ssize_t nbytes = size * sizeof(PyObject *); + Py_ssize_t nbytes = (size_t)size * sizeof(PyObject *); /* Check for overflow */ if (nbytes / sizeof(PyObject *) != (size_t)size || (nbytes > PY_SSIZE_T_MAX - sizeof(PyTupleObject) - sizeof(PyObject *))) @@ -446,7 +446,7 @@ return NULL; } #define b ((PyTupleObject *)bb) - size = Py_SIZE(a) + Py_SIZE(b); + size = (size_t)Py_SIZE(a) + Py_SIZE(b); if (size < 0) return PyErr_NoMemory(); np = (PyTupleObject *) PyTuple_New(size); @@ -490,7 +490,7 @@ if (Py_SIZE(a) == 0) return PyTuple_New(0); } - size = Py_SIZE(a) * n; + size = (size_t)Py_SIZE(a) * n; if (size/Py_SIZE(a) != n) return PyErr_NoMemory(); np = (PyTupleObject *) PyTuple_New(size);
