Allocate a few more bytes as gmarkup reads past the end of the allocated buffer
authorWim Taymans <wim.taymans@gmail.com>
Mon, 17 Jun 2002 19:23:05 +0000 (19:23 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 17 Jun 2002 19:23:05 +0000 (19:23 +0000)
Original commit message from CVS:
Allocate a few more bytes as gmarkup reads past the end of the
allocated buffer

gst/registries/gstxmlregistry.c

index 294011e..fa46921 100644 (file)
@@ -373,7 +373,8 @@ gst_xml_registry_add_path_list_func (GstXMLRegistry *registry)
     return;
   }
 
-  text = g_malloc (BLOCK_SIZE);
+  /* slightly allocate more as gmarkup reads too much */
+  text = g_malloc0 (BLOCK_SIZE + 32);
 
   size = fread (text, 1, BLOCK_SIZE, reg);
 
@@ -548,7 +549,7 @@ gst_xml_registry_load (GstRegistry *registry)
     return FALSE;
   }
 
-  text = g_malloc (BLOCK_SIZE);
+  text = g_malloc0 (BLOCK_SIZE + 32);
 
   size = BLOCK_SIZE;
   CLASS (xmlregistry)->load_func (xmlregistry, text, &size);