Jaap Keuter:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Dec 2005 01:36:42 +0000 (01:36 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 22 Dec 2005 01:36:42 +0000 (01:36 +0000)
While looking into bug 239 I found a type mismatch in proto.c. Even
though tree_is_expanded is defined as a (gboolean *) the memory
allocation is carried out using sizeof (gint *). The attached patch
fixes this.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16877 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c

index 6cce739965595bdddf9902761646d82202237e20..fdb8b12076d668ef532dc9d8d32bcafe9a68b66d 100644 (file)
@@ -344,8 +344,8 @@ proto_init(const char *plugin_dir
 
        /* We've assigned all the subtree type values; allocate the array
           for them, and zero it out. */
-       tree_is_expanded = g_malloc(num_tree_types*sizeof (gint *));
-       memset(tree_is_expanded, 0, num_tree_types*sizeof (gint *));
+       tree_is_expanded = g_malloc(num_tree_types*sizeof (gboolean));
+       memset(tree_is_expanded, 0, num_tree_types*sizeof (gboolean));
 }
 
 /* String comparison func for dfilter_token GTree */
@@ -3313,9 +3313,9 @@ proto_register_subtree_array(gint *const *indices, int num_indices)
        if (tree_is_expanded != NULL) {
                tree_is_expanded =
                    g_realloc(tree_is_expanded,
-                       (num_tree_types+num_indices)*sizeof (gint *));
+                       (num_tree_types+num_indices)*sizeof (gboolean));
                memset(tree_is_expanded + num_tree_types, 0,
-                   num_indices*sizeof (gint *));
+                   num_indices*sizeof (gboolean));
        }
 
        /*