Commit 5c3731ea authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

gst/gstregistryxml.c: Make sure we don't pass non-UTF-8 strings to...

gst/gstregistryxml.c: Make sure we don't pass non-UTF-8 strings to g_markup_escape(), since that can lead to random m...

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).
parent 8bfabdfe
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:
......
......@@ -594,7 +594,14 @@ gst_registry_save_escaped (GstRegistry * registry, char *prefix, char *tag,
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment