From ef3639050f9bccc3b28cf04f79ebcdd0ba6eb8ba Mon Sep 17 00:00:00 2001 From: Tomas Halman Date: Mon, 20 May 2024 10:21:00 +0200 Subject: [PATCH] Fix adopt function the same way as in upstream Related: RHEL-35381 --- 0001-resource-leaks.patch | 21 ++++----------------- xmlsec1.spec | 6 +++++- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/0001-resource-leaks.patch b/0001-resource-leaks.patch index 9f7d416..67190a8 100644 --- a/0001-resource-leaks.patch +++ b/0001-resource-leaks.patch @@ -33,29 +33,16 @@ diff -up xmlsec1-1.2.29/src/c14n.c.orig xmlsec1-1.2.29/src/c14n.c diff -up xmlsec1-1.2.29/src/gcrypt/asymkeys.c.orig xmlsec1-1.2.29/src/gcrypt/asymkeys.c --- xmlsec1-1.2.29/src/gcrypt/asymkeys.c.orig 2024-05-10 18:47:45.800368678 +0200 +++ xmlsec1-1.2.29/src/gcrypt/asymkeys.c 2024-05-13 09:11:08.784351577 +0200 -@@ -198,6 +198,9 @@ done: - gcry_sexp_release(priv_key); - } +@@ -186,6 +186,9 @@ xmlSecGCryptAsymKeyDataAdoptKey(xmlSecKe + pub_key = NULL; /* data owns it now */ + priv_key = NULL; /* data owns it now */ + /* Adopt functions assume ownership thus the caller would expect this to be released */ + gcry_sexp_release(key_pair); + - /* done */ - return(res); - } -@@ -292,11 +295,11 @@ xmlSecGCryptAsymKeyDataGenerate(xmlSecKe - } - - ret = xmlSecGCryptAsymKeyDataAdoptKey(data, key_pair); -+ key_pair = NULL; /* now owned by data */ - if(ret < 0) { - xmlSecInternalError("xmlSecGCryptAsymKeyDataAdopt", NULL); - goto done; - } -- key_pair = NULL; /* now owned by data */ - /* success */ res = 0; + diff -up xmlsec1-1.2.29/src/parser.c.orig xmlsec1-1.2.29/src/parser.c --- xmlsec1-1.2.29/src/parser.c.orig 2024-05-10 13:46:59.217160842 +0200 +++ xmlsec1-1.2.29/src/parser.c 2024-05-10 17:28:22.848994008 +0200 diff --git a/xmlsec1.spec b/xmlsec1.spec index 8814452..65f1579 100644 --- a/xmlsec1.spec +++ b/xmlsec1.spec @@ -1,7 +1,7 @@ Summary: Library providing support for "XML Signature" and "XML Encryption" standards Name: xmlsec1 Version: 1.2.29 -Release: 12%{?dist}%{?extra_release} +Release: 13%{?dist}%{?extra_release} License: MIT Source0: https://www.aleksey.com/xmlsec/download/xmlsec1-%{version}.tar.gz URL: http://www.aleksey.com/xmlsec/ @@ -178,6 +178,10 @@ mv %{buildroot}%{_docdir}/xmlsec1/* __tmp_doc %{_libdir}/pkgconfig/xmlsec1-nss.pc %changelog +* Mon May 20 2024 Tomas Halman - 1.2.29-12 +- Fix adopt function the same way as in upstream + Related: RHEL-35381 + * Fri May 17 2024 Tomas Halman - 1.2.29-12 - Fix double free in xmlSecGCryptAsymKeyDataGenerate Related: RHEL-35381