From 96a0c589eec8e66f0d879c2a0979df6fd2c23dde Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Mon, 20 Aug 2012 16:41:42 +0200 Subject: [PATCH] gmem.c: array is only paritally filled by memcpy The size of the local_data arrray is too large. It should not be multiplied by the sizeof guint. The memcpy of profile_data to local_data later will only fill a part of the array. Spotted with the PVS-Studio static analyzer https://bugzilla.gnome.org/show_bug.cgi?id=681501 --- glib/gmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gmem.c b/glib/gmem.c index 3283f2b..c221453 100644 --- a/glib/gmem.c +++ b/glib/gmem.c @@ -714,7 +714,7 @@ profile_print_locked (guint *local_data, void g_mem_profile (void) { - guint local_data[(MEM_PROFILE_TABLE_SIZE + 1) * 8 * sizeof (profile_data[0])]; + guint local_data[(MEM_PROFILE_TABLE_SIZE + 1) * 8]; gsize local_allocs; gsize local_zinit; gsize local_frees; -- 2.7.4