Fix excessive reference counting on faked string .decode()
This commit is contained in:
		
							parent
							
								
									d4f7fd8c04
								
							
						
					
					
						commit
						c7bd807f7c
					
				| @ -52,7 +52,7 @@ diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h | |||||||
| index 25938464a..803da0fc1 100644
 | index 25938464a..803da0fc1 100644
 | ||||||
| --- a/python/rpmsystem-py.h
 | --- a/python/rpmsystem-py.h
 | ||||||
| +++ b/python/rpmsystem-py.h
 | +++ b/python/rpmsystem-py.h
 | ||||||
| @@ -19,12 +19,30 @@
 | @@ -19,12 +19,29 @@
 | ||||||
|  #define PyInt_AsSsize_t PyLong_AsSsize_t |  #define PyInt_AsSsize_t PyLong_AsSsize_t | ||||||
|  #endif |  #endif | ||||||
|   |   | ||||||
| @ -76,7 +76,6 @@ index 25938464a..803da0fc1 100644 | |||||||
| +	    Py_DECREF(n);
 | +	    Py_DECREF(n);
 | ||||||
| +	}
 | +	}
 | ||||||
| +	if (fakedecode && o) {
 | +	if (fakedecode && o) {
 | ||||||
| +	    Py_INCREF(fakedecode);
 |  | ||||||
| +	    /* monkey-patch it into the string object as "decode" */
 | +	    /* monkey-patch it into the string object as "decode" */
 | ||||||
| +	    PyDict_SetItemString(Py_TYPE(o)->tp_dict, "decode", fakedecode);
 | +	    PyDict_SetItemString(Py_TYPE(o)->tp_dict, "decode", fakedecode);
 | ||||||
| +	}
 | +	}
 | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								rpm.spec
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								rpm.spec
									
									
									
									
									
								
							| @ -23,7 +23,7 @@ | |||||||
| 
 | 
 | ||||||
| %global rpmver 4.14.2.1 | %global rpmver 4.14.2.1 | ||||||
| #global snapver rc2 | #global snapver rc2 | ||||||
| %global rel 6 | %global rel 7 | ||||||
| 
 | 
 | ||||||
| %global srcver %{version}%{?snapver:-%{snapver}} | %global srcver %{version}%{?snapver:-%{snapver}} | ||||||
| %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} | %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/* | %doc doc/librpm/html/* | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Thu Apr 11 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-7 | ||||||
|  | - Fix excessive reference counting on faked string .decode() | ||||||
|  | 
 | ||||||
| * Wed Apr 10 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-6 | * Wed Apr 10 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-6 | ||||||
| - Unbreak Python 3 API by returning string data as surrogate-escaped utf-8 | - Unbreak Python 3 API by returning string data as surrogate-escaped utf-8 | ||||||
|   string objects instead of bytes (#1693751) |   string objects instead of bytes (#1693751) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user