[PATCH] grl-plugin-registry: Fix issue with badly created string
- From: Joaquim Rocha <jrocha igalia com>
- To: grilo-list gnome org
- Subject: [PATCH] grl-plugin-registry: Fix issue with badly created string
- Date: Mon, 14 Jun 2010 10:58:20 +0200
---
src/grl-plugin-registry.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c
index 71278f8..dcf2428 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -244,11 +244,12 @@ get_xml_path_from_plugin_path (const gchar *path)
}
extension_index = g_utf8_pointer_to_offset (path, extension);
- path_prefix = (gchar *) g_malloc(extension - path);
+ path_prefix = (gchar *) g_malloc (extension_index + 1);
g_utf8_strncpy (path_prefix,
path,
extension_index);
- xml_path = g_strconcat (path_prefix, "xml", NULL);
+ path_prefix[extension_index] = '\0';
+ xml_path = g_strconcat (path_prefix, "xml", NULL);
g_free (path_prefix);
return xml_path;
--
1.7.0.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]