From 22b8f2b10b5b7e2631c6ed98e2d63adbb6405d12 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 9 Oct 2017 13:10:17 +0200 Subject: [PATCH] Fix memory corruption due to allocator mix (rhbz#1498207) --- ...fix-memory-corruption-due-to-allocator-mix.patch | 13 +++++++++++++ python3.spec | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 00279-fix-memory-corruption-due-to-allocator-mix.patch diff --git a/00279-fix-memory-corruption-due-to-allocator-mix.patch b/00279-fix-memory-corruption-due-to-allocator-mix.patch new file mode 100644 index 0000000..4937391 --- /dev/null +++ b/00279-fix-memory-corruption-due-to-allocator-mix.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/getpath.c b/Modules/getpath.c +index c4055be..1258fcd 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -735,7 +735,7 @@ calculate_path(void) + bufsz += wcslen(zip_path) + 1; + bufsz += wcslen(exec_prefix) + 1; + +- buf = PyMem_New(wchar_t, bufsz); ++ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); + if (buf == NULL) { + Py_FatalError( + "Not enough memory for dynamic PYTHONPATH"); diff --git a/python3.spec b/python3.spec index 492fbad..53def0a 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.3 -Release: 1%{?dist} +Release: 2%{?dist} License: Python @@ -385,6 +385,11 @@ Patch274: 00274-fix-arch-names.patch # Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 Patch277: 00277-fix-test-subprocess-hanging-tests.patch +# 00279 # +# Fix memory corruption due to allocator mix +# Fixed upstream: https://bugs.python.org/issue31532 +Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1532,6 +1537,10 @@ fi # ====================================================== %changelog +* Mon Oct 09 2017 Charalampos Stratakis - 3.6.3-2 +- Fix memory corruption due to allocator mix +Resolves: rhbz#1498207 + * Fri Oct 06 2017 Charalampos Stratakis - 3.6.3-1 - Update to Python 3.6.3