Merge from trunk:

2007-06-15  Cody Russell  <cody@jhu.edu>

	Merge from trunk:

	* gobject/gtype.c (g_type_class_add_private): Check for 0-sized
	private data. (#443869)


svn path=/branches/glib-2-12/; revision=5562
This commit is contained in:
Cody Russell 2007-06-15 06:33:14 +00:00 committed by Cody Russell
parent 5acfdc7ca2
commit 528be68c00
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-06-15 Cody Russell <cody@jhu.edu>
Merge from trunk:
* gobject/gtype.c (g_type_class_add_private): Check for 0-sized
private data. (#443869)
2007-06-11 Tor Lillqvist <tml@novell.com> 2007-06-11 Tor Lillqvist <tml@novell.com>
* glib/gwin32.c (g_win32_get_package_installation_directory) * glib/gwin32.c (g_win32_get_package_installation_directory)

View File

@ -3483,6 +3483,8 @@ g_type_class_add_private (gpointer g_class,
TypeNode *node = lookup_type_node_I (instance_type); TypeNode *node = lookup_type_node_I (instance_type);
gsize offset; gsize offset;
g_return_if_fail (private_size > 0);
if (!node || !node->is_instantiatable || !node->data || node->data->class.class != g_class) if (!node || !node->is_instantiatable || !node->data || node->data->class.class != g_class)
{ {
g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'", g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'",