gobject: initialize memory in g_object_new_valist
authorJonas Holmberg <jonas.holmberg@axis.com>
Thu, 23 Sep 2010 23:20:50 +0000 (01:20 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 28 Nov 2010 23:27:30 +0000 (18:27 -0500)
memset parameters array in g_object_new_valist to zeroes when expanding
the array to avoid acces to uninitialized memory.

gobject/gobject.c

index e6f19da..8b427fa 100644 (file)
@@ -1565,6 +1565,7 @@ g_object_new_valist (GType          object_type,
        {
          n_alloced_params += 16;
          params = g_renew (GParameter, params, n_alloced_params);
+         memset (params + n_params, 0, 16 * (sizeof *params));
        }
       params[n_params].name = name;
       G_VALUE_COLLECT_INIT (&params[n_params].value, pspec->value_type,