summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Check-for-empty-closures.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0001-Check-for-empty-closures.patch')
-rw-r--r--debian/patches/0001-Check-for-empty-closures.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/patches/0001-Check-for-empty-closures.patch b/debian/patches/0001-Check-for-empty-closures.patch
new file mode 100644
index 0000000..6f37f56
--- /dev/null
+++ b/debian/patches/0001-Check-for-empty-closures.patch
@@ -0,0 +1,36 @@
+From eef3b1f8662bf76095987eeef41308094693cf3e Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Wed, 29 Mar 2023 19:42:51 +0100
+Subject: [PATCH] Check for empty closures
+
+The closure field of the callback info structure can be NULL, which
+means we need to check before calling functions on it.
+
+Fixes: https://rt.cpan.org/Public/Bug/Display.html?id=147409
+
+Closes: #4
+---
+ gperl-i11n-marshal-callback.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gperl-i11n-marshal-callback.c b/gperl-i11n-marshal-callback.c
+index 14ad003..d422de6 100644
+--- a/gperl-i11n-marshal-callback.c
++++ b/gperl-i11n-marshal-callback.c
+@@ -57,8 +57,11 @@ sv_to_callback (GIArgInfo * arg_info,
+ callback_info->closure, callback_info);
+
+ #if GI_CHECK_VERSION (1, 72, 0)
+- return g_callable_info_get_closure_native_address (callback_interface_info,
+- callback_info->closure);
++ if (callback_info->closure)
++ return g_callable_info_get_closure_native_address (callback_interface_info,
++ callback_info->closure);
++ else
++ return NULL;
+ #else
+ return callback_info->closure;
+ #endif
+--
+2.40.1
+