From c7bd807f7c9d21e9edcf015236411fc214fd263e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Apr 11 2019 07:38:45 +0000 Subject: Fix excessive reference counting on faked string .decode() --- diff --git a/0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch b/0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch index e655848..6df9fab 100644 --- a/0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch +++ b/0001-Monkey-patch-.decode-method-to-our-strings-as-a-temp.patch @@ -52,7 +52,7 @@ diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index 25938464a..803da0fc1 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h -@@ -19,12 +19,30 @@ +@@ -19,12 +19,29 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #endif @@ -76,7 +76,6 @@ index 25938464a..803da0fc1 100644 + Py_DECREF(n); + } + if (fakedecode && o) { -+ Py_INCREF(fakedecode); + /* monkey-patch it into the string object as "decode" */ + PyDict_SetItemString(Py_TYPE(o)->tp_dict, "decode", fakedecode); + } diff --git a/rpm.spec b/rpm.spec index 11c05da..5abd401 100644 --- a/rpm.spec +++ b/rpm.spec @@ -23,7 +23,7 @@ %global rpmver 4.14.2.1 #global snapver rc2 -%global rel 6 +%global rel 7 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -576,6 +576,9 @@ make check || (cat tests/rpmtests.log; exit 1) %doc doc/librpm/html/* %changelog +* Thu Apr 11 2019 Panu Matilainen - 4.14.2.1-7 +- Fix excessive reference counting on faked string .decode() + * Wed Apr 10 2019 Panu Matilainen - 4.14.2.1-6 - Unbreak Python 3 API by returning string data as surrogate-escaped utf-8 string objects instead of bytes (#1693751)