[gpa PATCH] Fix incorrect callback arguments

Sam James sam at gentoo.org
Sun Aug 10 04:36:11 CEST 2025


Some users reported a crash downstream in Gentoo with g_type_check_is_value_type
getting a garbage type. This turns out to be because
95e07080a2a08196cafb05b69345ea1d629424b1 replaced the types (and argument
counts) incorrectly.

Fix that by adding to gpa_marshal.list to create custom marshal types
and use those instead, and fix the argument count.

Bug: https://bugs.gentoo.org/957196
Fixes: 95e07080a2a08196cafb05b69345ea1d629424b1
Signed-off-by: Sam James <sam at gentoo.org>
---
Note that I've sent a DCO before in August 2022 but I don't spot it in
the archives at a glance, so sent it again just now.

 src/gpa-marshal.list | 2 ++
 src/gpacontext.c     | 5 +++--
 src/gpakeyexpireop.c | 3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gpa-marshal.list b/src/gpa-marshal.list
index 081ce17..941257d 100644
--- a/src/gpa-marshal.list
+++ b/src/gpa-marshal.list
@@ -1 +1,3 @@
 INT:STRING,STRING
+VOID:INT,INT
+VOID:POINTER,POINTER
diff --git a/src/gpacontext.c b/src/gpacontext.c
index 91bd85f..31301c0 100644
--- a/src/gpacontext.c
+++ b/src/gpacontext.c
@@ -25,6 +25,7 @@
 #include "gpa.h"
 #include "gpgmetools.h"
 #include "gpacontext.h"
+#include "gpa-marshal.h"
 
 /* GObject type functions */
 
@@ -145,9 +146,9 @@ gpa_context_class_init (GpaContextClass *klass)
                         G_SIGNAL_RUN_FIRST,
                         G_STRUCT_OFFSET (GpaContextClass, progress),
                         NULL, NULL,
-                        g_cclosure_marshal_VOID__INT,
+                        gpa_marshal_VOID__INT_INT,
                         G_TYPE_NONE, 2,
-			G_TYPE_INT);
+			G_TYPE_INT, G_TYPE_INT);
 }
 
 static void
diff --git a/src/gpakeyexpireop.c b/src/gpakeyexpireop.c
index a489087..25e489e 100644
--- a/src/gpakeyexpireop.c
+++ b/src/gpakeyexpireop.c
@@ -31,6 +31,7 @@
 #endif
 
 #include "gpa.h"
+#include "gpa-marshal.h"
 #include "gpakeyexpireop.h"
 #include "expirydlg.h"
 #include "gpgmeedit.h"
@@ -114,7 +115,7 @@ gpa_key_expire_operation_class_init (GpaKeyExpireOperationClass *klass)
 		  G_SIGNAL_RUN_FIRST,
 		  G_STRUCT_OFFSET (GpaKeyExpireOperationClass, new_expiration),
 		  NULL, NULL,
-		  g_cclosure_marshal_VOID__POINTER,
+		  gpa_marshal_VOID__POINTER_POINTER,
 		  G_TYPE_NONE, 2,
 		  G_TYPE_POINTER,
 		  G_TYPE_POINTER);
-- 
2.50.1




More information about the Gnupg-devel mailing list