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:
Carlos Soriano 2015-09-25 13:57:24 +02:00
parent ecc698a282
commit 6e83c3b92e

View File

@ -145,7 +145,7 @@ save_bookmarks (GFile *bookmarks_file,
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_c (contents, '\n');