From e2f4ed162bf0aef9ec1eb965a072707cd39be08c Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sun, 13 Mar 2022 08:22:56 +0100 Subject: [PATCH] mmsd: Fix total max attachment size On amd64 and arm64 gsize is typedef'ed to unsigned long (64 bit wide). The "i" GVariant format string is for gint32 the g_variant_get() family of functions (g_variant_dict_lookup in this case). Casting explicitly makes sure we don't end up with garbage in the upper 32 bits. Fixes 9c627f52992e37c0cae788270fcbfdc642995585 Closes #686 --- src/mm/chatty-mmsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mm/chatty-mmsd.c b/src/mm/chatty-mmsd.c index 2c911fb6..6b017550 100644 --- a/src/mm/chatty-mmsd.c +++ b/src/mm/chatty-mmsd.c @@ -1358,7 +1358,7 @@ chatty_mmsd_get_mmsd_service_settings_cb (GObject *service, } else { g_autoptr(GVariant) all_settings = NULL; GVariantDict dict; - gsize max_attach_total_size; + int max_attach_total_size; int max_attachments; gboolean autocreatesmil; @@ -1366,7 +1366,7 @@ chatty_mmsd_get_mmsd_service_settings_cb (GObject *service, g_variant_dict_init (&dict, all_settings); if (g_variant_dict_lookup (&dict, "TotalMaxAttachmentSize", "i", &max_attach_total_size)) - self->max_attach_size = max_attach_total_size; + self->max_attach_size = (gsize) max_attach_total_size; else self->max_attach_size = DEFAULT_MAXIMUM_ATTACHMENT_SIZE; -- GitLab