summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-mempool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c
index 0d62e62b..2fde2568 100644
--- a/dbus/dbus-mempool.c
+++ b/dbus/dbus-mempool.c
@@ -139,6 +139,10 @@ _dbus_mem_pool_new (int element_size,
if (pool == NULL)
return NULL;
+ /* Make the element size at least 8 bytes. */
+ if (element_size < 8)
+ element_size = 8;
+
/* these assertions are equivalent but the first is more clear
* to programmers that see it fail.
*/