diff --git a/bugfix-excessive-memory-usage-when-using-regular-expressions.patch b/bugfix-excessive-memory-usage-when-using-regular-expressions.patch new file mode 100644 index 0000000000000000000000000000000000000000..86dc715df4dc1e0543fde0c0ec469d5ac166c0c3 --- /dev/null +++ b/bugfix-excessive-memory-usage-when-using-regular-expressions.patch @@ -0,0 +1,25 @@ +diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py +index b6689fa..0063845 100644 +--- a/Lib/sre_compile.py ++++ b/Lib/sre_compile.py +@@ -271,7 +271,7 @@ def _optimize_charset(charset, fixup, fixes, isunicode): + else: + charmap[av] = 1 + elif op is RANGE: +- r = range(av[0], av[1]+1) ++ r = xrange(av[0], av[1]+1) + if fixup: + r = map(fixup, r) + if fixup and fixes: +@@ -374,7 +374,7 @@ def _optimize_charset(charset, fixup, fixes, isunicode): + mapping = bytearray(256) + block = 0 + data = bytearray() +- for i in range(0, 65536, 256): ++ for i in xrange(0, 65536, 256): + chunk = charmap[i: i + 256] + if chunk in comps: + mapping[i // 256] = comps[chunk] +-- +1.8.3.1 + diff --git a/python2.spec b/python2.spec index cc1258ef3dbe3a74440874bf78a5023864d4afe1..8935f60d5e42f7b8acb5d61e273dec581005cb30 100644 --- a/python2.spec +++ b/python2.spec @@ -15,7 +15,7 @@ %undefine _debuginfo_subpackages Name: python2 Version: 2.7.16 -Release: 13 +Release: 14 Summary: Python is an interpreted, interactive object-oriented programming language suitable License: Python URL: https://www.python.org/ @@ -99,6 +99,7 @@ Patch6055: CVE-2018-20852.patch Patch6056: CVE-2019-16935.patch Patch6057: CVE-2019-17514.patch Patch6058: CVE-2017-18207.patch +Patch6059: bugfix-excessive-memory-usage-when-using-regular-expressions.patch BuildRequires: libdb-devel libffi-devel valgrind-devel ncurses-devel expat-devel readline-devel BuildRequires: openssl-devel libtirpc-devel tcl-devel tk-devel glibc-devel libnsl2-devel @@ -633,6 +634,12 @@ sed -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" %{SOURCE1} \ %{dynload_dir}/_testcapimodule_d.so %changelog +* Sat Feb 29 2020 hanxinke - 2.7.16-14 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix excessive memory usage when using regular expressions + * Sat Feb 22 2020 openEuler Buildteam - 2.7.16-13 - Type:bugfix - Id:NA