From 999c29745fbba6572f3c3a1996fafdcd46d0d16d Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sun, 22 May 2022 22:08:32 +0000 Subject: [PATCH] dbus-mempool.c: Ensure element_size is at least sizeof(void *) I am trying to use DBus on an Arm Morello system where sizeof(void *) is 16 and not 8, so the assertion in the line below can fail unless we ensure that element_size is at least sizeof(void *). --- dbus/dbus-mempool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c index 83aa2722a..737cf201e 100644 --- a/dbus/dbus-mempool.c +++ b/dbus/dbus-mempool.c @@ -149,7 +149,9 @@ _dbus_mem_pool_new (int element_size, /* Make the element size at least 8 bytes. */ if (element_size < 8) element_size = 8; - + if (element_size < (int) sizeof (void *)) + element_size = sizeof (void *); + /* these assertions are equivalent but the first is more clear * to programmers that see it fail. */ -- 2.47.3