+-
+-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+-From: Ernestas Kulik <ekulik@redhat.com>
+-Date: Tue, 29 Jan 2019 09:50:46 +0100
+-Subject: [PATCH 10/10] gdbus: Avoid printing null strings
+-
+-This mostly affects the 2.56 branch, but, given that GCC 9 is being
+-stricter about passing null string pointers to printf-like functions, it
+-might make sense to proactively fix such calls.
+-
+-gdbusauth.c: In function '_g_dbus_auth_run_server':
+-gdbusauth.c:1302:11: error: '%s' directive argument is null
+-[-Werror=format-overflow=]
+- 1302 | debug_print ("SERVER: WaitingForBegin, read '%s'",
+- line);
+- |
+-
+-gdbusmessage.c: In function ‘g_dbus_message_to_blob’:
+-gdbusmessage.c:2730:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
+- 2730 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+- |
+-
+-diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
+-index 1111111..2222222 100644
+---- a/gio/gdbusauth.c
+-+++ b/gio/gdbusauth.c
+-@@ -1295,9 +1295,9 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
+- &line_length,
+- cancellable,
+- error);
+-- debug_print ("SERVER: WaitingForBegin, read '%s'", line);
+- if (line == NULL)
+- goto out;
+-+ debug_print ("SERVER: WaitingForBegin, read '%s'", line);
+- if (g_strcmp0 (line, "BEGIN") == 0)
+- {
+- /* YAY, done! */
+-diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
+-index 1111111..2222222 100644
+---- a/gio/gdbusmessage.c
+-+++ b/gio/gdbusmessage.c
+-@@ -2695,7 +2695,6 @@ g_dbus_message_to_blob (GDBusMessage *message,
+- if (message->body != NULL)
+- {
+- gchar *tupled_signature_str;
+-- tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+- if (signature == NULL)
+- {
+- g_set_error (error,
+-@@ -2703,10 +2702,10 @@ g_dbus_message_to_blob (GDBusMessage *message,
+- G_IO_ERROR_INVALID_ARGUMENT,
+- _("Message body has signature '%s' but there is no signature header"),
+- signature_str);
+-- g_free (tupled_signature_str);
+- goto out;
+- }
+-- else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
+-+ tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+-+ if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
+- {
+- g_set_error (error,
+- G_IO_ERROR,
+diff --git a/src/glib-2-format.patch b/src/glib-2-format.patch
+new file mode 100644
+index 00000000..3d594af0
+--- /dev/null
++++ b/src/glib-2-format.patch
+@@ -0,0 +1,77 @@
++--- a/configure.ac.orig 2018-10-03 16:23:45.065890113 +0200
+++++ b/configure.ac 2018-10-03 16:28:04.378188119 +0200
++@@ -562,7 +562,7 @@ AS_IF([test x$glib_native_win32 != xyes
++ # long long is a 64 bit integer.
++ AC_MSG_CHECKING(for format to printf and scanf a guint64)
++ AC_CACHE_VAL(glib_cv_long_long_format,[
++- for format in ll q I64; do
+++ for format in ll q; do
++ AC_TRY_RUN([#include <stdio.h>
++ int main()
++ {
++@@ -588,7 +588,7 @@ AS_IF([test x$glib_native_win32 != xyes
++ # __int64 is a 64 bit integer.
++ AC_MSG_CHECKING(for format to printf and scanf a guint64)
++ # We know this is MSVCRT.DLL, and what the formats are
++- glib_cv_long_long_format=I64
+++ glib_cv_long_long_format=ll
++ AC_MSG_RESULT(%${glib_cv_long_long_format}u)
++ AC_DEFINE(HAVE_LONG_LONG_FORMAT,1,[define if system printf can print long long])
++ AC_DEFINE(HAVE_INT64_AND_I64,1,[define to support printing 64-bit integers with format I64])
++@@ -3176,8 +3176,8 @@ $ac_cv_sizeof___int64)
++ guint64_format='"'$glib_cv_long_long_format'u"'
++ fi
++ glib_extension=
++- gint64_constant='(val##i64)'
++- guint64_constant='(val##ui64)'
+++ gint64_constant='(val##ll)'
+++ guint64_constant='(val##ull)'
++ ;;
++ esac
++ glib_size_t=$ac_cv_sizeof_size_t
++@@ -3204,8 +3204,8 @@ long)
++ glib_msize_type='LONG'
++ ;;
++ "long long"|__int64)
++- gsize_modifier='"I64"'
++- gsize_format='"I64u"'
+++ gsize_modifier='"ll"'
+++ gsize_format='"llu"'
++ glib_msize_type='INT64'
++ ;;
++ esac
++@@ -3227,8 +3227,8 @@ long)
++ glib_mssize_type='LONG'
++ ;;
++ "long long"|__int64)
++- gssize_modifier='"I64"'
++- gssize_format='"I64i"'
+++ gssize_modifier='"ll"'
+++ gssize_format='"lli"'
++ glib_mssize_type='INT64'
++ ;;
++ esac
++@@ -3257,17 +3257,17 @@ $ac_cv_sizeof_long)
++ ;;
++ $ac_cv_sizeof_long_long)
++ glib_intptr_type_define='long long'
++- gintptr_modifier='"I64"'
++- gintptr_format='"I64i"'
++- guintptr_format='"I64u"'
+++ gintptr_modifier='"ll"'
+++ gintptr_format='"lli"'
+++ guintptr_format='"llu"'
++ glib_gpi_cast='(gint64)'
++ glib_gpui_cast='(guint64)'
++ ;;
++ $ac_cv_sizeof___int64)
++ glib_intptr_type_define=__int64
++- gintptr_modifier='"I64"'
++- gintptr_format='"I64i"'
++- guintptr_format='"I64u"'
+++ gintptr_modifier='"ll"'
+++ gintptr_format='"lli"'
+++ guintptr_format='"llu"'
++ glib_gpi_cast='(gint64)'
++ glib_gpui_cast='(guint64)'
++ ;;