[neon/forks/sip6/Neon/release] debian: Backport upstream patch to fix stack smashing when running tests.

Dmitry Shachnev null at kde.org
Mon Jul 27 12:04:48 BST 2026


Git commit 947d0de50db8eb10b4277e0c78b3846a4d8eef52 by Dmitry Shachnev.
Committed on 14/03/2026 at 17:01.
Pushed by carlosdem into branch 'Neon/release'.

Backport upstream patch to fix stack smashing when running tests.

M  +1    -0    debian/changelog
A  +50   -0    debian/patches/fix_stack_smashing.diff
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/forks/sip6/-/commit/947d0de50db8eb10b4277e0c78b3846a4d8eef52

diff --git a/debian/changelog b/debian/changelog
index e73f9a0..d30589d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ sip6 (6.15.2-1) UNRELEASED; urgency=medium
   * New upstream release.
   * Refresh debian/patches/intersphinx_local.diff.
   * Add a patch to not overwrite CXXFLAGS in the tests.
+  * Backport upstream patch to fix stack smashing when running tests.
 
  -- Dmitry Shachnev <mitya57 at debian.org>  Mon, 09 Mar 2026 18:37:05 +0300
 
diff --git a/debian/patches/fix_stack_smashing.diff b/debian/patches/fix_stack_smashing.diff
new file mode 100644
index 0000000..3e8b638
--- /dev/null
+++ b/debian/patches/fix_stack_smashing.diff
@@ -0,0 +1,50 @@
+From: Phil Thompson <phil at riverbankcomputing.com>
+Date: Sat, 14 Mar 2026 15:47:26 +0000
+Subject: Fixed the handling of virtuals that return enums with a non-int base
+ type
+
+(cherry picked from commit 7b9e5a72ed44981aa06655fbeb8bbaf7c1ee8d5b)
+---
+ sipbuild/generator/outputs/code/snippets.py | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/sipbuild/generator/outputs/code/snippets.py b/sipbuild/generator/outputs/code/snippets.py
+index 8c0f619..a49a338 100644
+--- a/sipbuild/generator/outputs/code/snippets.py
++++ b/sipbuild/generator/outputs/code/snippets.py
+@@ -3893,7 +3893,14 @@ f'''
+     sf.write(')\n{\n')
+ 
+     if result_is_returned:
+-        result_plain_decl = fmt_argument_as_cpp_type(spec, result, plain=True)
++        decl = fmt_argument_as_cpp_type(spec, result, plain=True)
++
++        if _arg_is_v13_typed_enum(spec, result):
++            result_plain_decl = 'int'
++            result_cast = '(' + decl + ')'
++        else:
++            result_plain_decl = decl
++            result_cast = ''
+ 
+         if result_instance_code is not None:
+             sf.write(
+@@ -3995,8 +4002,8 @@ f'''
+ 
+         if result_is_returned:
+             sf.write(
+-'''
+-    return sipRes;
++f'''
++    return {result_cast}sipRes;
+ ''')
+ 
+         sf.write('}\n')
+@@ -4097,7 +4104,7 @@ f'    PyObject *sipResObj = sipCallMethod({context}SIP_NULLPTR, sipMethod, ')
+ 
+         sf.write(
+ f'''
+-    return {result_ref}sipRes;
++    return {result_cast}{result_ref}sipRes;
+ ''')
+ 
+     sf.write('}\n')
diff --git a/debian/patches/series b/debian/patches/series
index 104b254..e94f536 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 intersphinx_local.diff
 system_ply.diff
 test_cxxflags.diff
+fix_stack_smashing.diff



More information about the Neon-commits mailing list