[python/f14/master] fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
dmalcolm
dmalcolm at fedoraproject.org
Fri Sep 24 23:16:42 UTC 2010
commit 790e7e7c7022149374e309801998ea9664a4118e
Author: David Malcolm <dmalcolm at redhat.com>
Date: Fri Sep 24 19:14:44 2010 -0400
fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
fix-dbm_contains-on-64bit-bigendian.patch | 25 +++++++++++++++++++++++++
python.spec | 10 +++++++++-
2 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/fix-dbm_contains-on-64bit-bigendian.patch b/fix-dbm_contains-on-64bit-bigendian.patch
new file mode 100644
index 0000000..e9ed979
--- /dev/null
+++ b/fix-dbm_contains-on-64bit-bigendian.patch
@@ -0,0 +1,25 @@
+Index: Modules/dbmmodule.c
+===================================================================
+--- Modules/dbmmodule.c (revision 84317)
++++ Modules/dbmmodule.c (working copy)
+@@ -168,12 +168,18 @@
+ dbm_contains(register dbmobject *dp, PyObject *v)
+ {
+ datum key, val;
++ Py_ssize_t dsize;
+
+- if (PyString_AsStringAndSize(v, (char **)&key.dptr,
+- (Py_ssize_t *)&key.dsize)) {
++ if (PyString_AsStringAndSize(v, (char **)&key.dptr, &dsize)) {
+ return -1;
+ }
+
++ /* Coerce from Py_ssize_t down to int: */
++ if (dsize > INT_MAX) {
++ return -1;
++ }
++ key.dsize = dsize;
++
+ /* Expand check_dbmobject_open to return -1 */
+ if (dp->di_dbm == NULL) {
+ PyErr_SetString(DbmError, "DBM object has already been closed");
diff --git a/python.spec b/python.spec
index fe9d7ab..a3f5a72 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 8%{?dist}.1
+Release: 8%{?dist}.2
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -435,6 +435,10 @@ Patch124: fix-test_commands-expected-ls-output-issue7108.patch
# Not yet sent upstream:
Patch125: less-verbose-COUNT_ALLOCS.patch
+# Fix dbm module on big-endian 64-bit
+# Sent upstream as http://bugs.python.org/issue9687 (rhbz#626756)
+Patch126: fix-dbm_contains-on-64bit-bigendian.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -683,6 +687,7 @@ pushd Lib
popd
%patch124 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
+%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1629,6 +1634,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Sep 24 2010 David Malcolm <dmalcolm at redhat.com> - 2.7-8.2
+- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
+
* Thu Sep 16 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 2.7-8.1
- backport a patch to fix a change in behaviour in configparse.
More information about the scm-commits
mailing list