commit:     5b49c674bfabf358f918fce4980be84af32e5d30
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  5 08:35:37 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 08:52:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b49c674

dev-python/xmlsec: fix modern C issue

Closes: https://bugs.gentoo.org/920769
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/xmlsec/files/xmlsec-1.3.14-c99.patch | 24 ++++++++++++++++++++++++
 dev-python/xmlsec/xmlsec-1.3.14.ebuild          |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/dev-python/xmlsec/files/xmlsec-1.3.14-c99.patch 
b/dev-python/xmlsec/files/xmlsec-1.3.14-c99.patch
new file mode 100644
index 000000000000..1cbdb717d9e9
--- /dev/null
+++ b/dev-python/xmlsec/files/xmlsec-1.3.14-c99.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/920769
+https://github.com/xmlsec/python-xmlsec/issues/311
+https://github.com/xmlsec/python-xmlsec/pull/325
+https://github.com/xmlsec/python-xmlsec/commit/67cd4ac73e4fceac4b4eb6a320067cad33f79213
+
+From 67cd4ac73e4fceac4b4eb6a320067cad33f79213 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]>
+Date: Wed, 19 Jun 2024 17:43:07 +0200
+Subject: [PATCH] Explicitly cast the pointer type in
+ PyXmlSec_ClearReplacedNodes
+
+Fixes https://github.com/xmlsec/python-xmlsec/issues/323
+--- a/src/enc.c
++++ b/src/enc.c
+@@ -204,7 +204,7 @@ static void PyXmlSec_ClearReplacedNodes(xmlSecEncCtxPtr 
ctx, PyXmlSec_LxmlDocume
+         PYXMLSEC_DEBUGF("clear replaced node %p", n);
+         nn = n->next;
+         // if n has references, it will not be deleted
+-        elem = PyXmlSec_elementFactory(doc, n);
++        elem = (PyXmlSec_LxmlElementPtr*)PyXmlSec_elementFactory(doc, n);
+         if (NULL == elem)
+             xmlFreeNode(n);
+         else
+

diff --git a/dev-python/xmlsec/xmlsec-1.3.14.ebuild 
b/dev-python/xmlsec/xmlsec-1.3.14.ebuild
index c478fef45bc2..2c874200e845 100644
--- a/dev-python/xmlsec/xmlsec-1.3.14.ebuild
+++ b/dev-python/xmlsec/xmlsec-1.3.14.ebuild
@@ -42,6 +42,10 @@ BDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}"/${P}-c99.patch
+)
+
 EPYTEST_DESELECT=(
        # Fragile based on black version?
        tests/test_type_stubs.py::test_xmlsec_constants_stub

Reply via email to