mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
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).
This commit is contained in:
parent
8bfabdfe1c
commit
5c3731ea37
2 changed files with 15 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue