summaryrefslogtreecommitdiff
path: root/dbus/dbus-memory.h
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-08-23 09:01:03 +0100
committerSimon McVittie <smcv@collabora.com>2018-08-30 17:25:36 +0100
commit7de841d7d9b989640c74fa03155389a632dadf11 (patch)
treef3fbadbe73174f1d47ddbf5dae6752fc99bd4ccf /dbus/dbus-memory.h
parentb805744029e6c497b0b92051199a304636e82fcd (diff)
downloaddbus-7de841d7d9b989640c74fa03155389a632dadf11.tar.gz
Do not apply __attribute__((__malloc__)) to dbus_realloc()
As noted in GLib commit c879f50f, gcc's interpretation of the malloc attribute has become more strict over time, which could result in miscompilation. The new definition is that in addition to assuming that the returned memory block is newly-allocated, gcc now assumes that it does not contain any valid pointers. This is OK for uninitialized or zero-initialized memory returned by dbus_malloc() or dbus_malloc0(), but not valid for dbus_realloc(), which might be used for a dynamically-sized array of (structures containing) valid pointers. See https://gitlab.gnome.org/GNOME/glib/issues/1465 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107741
Diffstat (limited to 'dbus/dbus-memory.h')
-rw-r--r--dbus/dbus-memory.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/dbus/dbus-memory.h b/dbus/dbus-memory.h
index 4fd56bd6..c575b46f 100644
--- a/dbus/dbus-memory.h
+++ b/dbus/dbus-memory.h
@@ -48,7 +48,6 @@ DBUS_ALLOC_SIZE(1)
void* dbus_malloc0 (size_t bytes);
DBUS_EXPORT
-DBUS_MALLOC
DBUS_ALLOC_SIZE(2)
void* dbus_realloc (void *memory,
size_t bytes);