From: Alex Richardson Date: Sun, 22 May 2022 22:08:32 +0000 (+0000) Subject: dbus-mempool.c: Ensure element_size is at least sizeof(void *) X-Git-Tag: dbus-1.15.0~47^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=999c29745fbba6572f3c3a1996fafdcd46d0d16d;p=thirdparty%2Fdbus.git 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 *). --- 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. */