Original commit message from CVS:
* gst/gstregistryxml.c: (gst_registry_save_escaped):
Make sure we don't pass non-UTF-8 strings to g_markup_escape(),
since that can lead to random memory corruptions and crashes
(may or may not be related to #383244, #386711, and #386711).
+2006-12-26 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/gstregistryxml.c: (gst_registry_save_escaped):
+ Make sure we don't pass non-UTF-8 strings to g_markup_escape(),
+ since that can lead to random memory corruptions and crashes
+ (may or may not be related to #383244, #386711, and #386711).
+
2006-12-21 Stefan Kost <ensonic@users.sf.net>
* tests/check/.cvsignore:
gboolean ret = TRUE;
if (value) {
- gchar *v = g_markup_escape_text (value, strlen (value));
+ gchar *v;
+
+ if (g_utf8_validate (value, -1, NULL)) {
+ v = g_markup_escape_text (value, -1);
+ } else {
+ g_warning ("Invalid UTF-8 while saving registry tag '%s'", tag);
+ v = g_strdup ("[ERROR: invalid UTF-8]");
+ }
ret = gst_registry_save (registry, "%s<%s>%s</%s>\n", prefix, tag, v, tag);
g_free (v);