forked from AuroraMiddleware/gtk
gtkbookmarksmanager: don't allow non valid utf8 in bookmarks
In case some client send to us a non valid utf8 string, don't screw up the bookmarks file and just return. https://bugzilla.gnome.org/show_bug.cgi?id=755215
This commit is contained in:
parent
ecc698a282
commit
6e83c3b92e
@ -145,7 +145,7 @@ save_bookmarks (GFile *bookmarks_file,
|
|||||||
|
|
||||||
g_string_append (contents, uri);
|
g_string_append (contents, uri);
|
||||||
|
|
||||||
if (bookmark->label)
|
if (bookmark->label && g_utf8_validate (bookmark->label, -1, NULL))
|
||||||
g_string_append_printf (contents, " %s", bookmark->label);
|
g_string_append_printf (contents, " %s", bookmark->label);
|
||||||
|
|
||||||
g_string_append_c (contents, '\n');
|
g_string_append_c (contents, '\n');
|
||||||
|
Loading…
Reference in New Issue
Block a user