# HG changeset patch # User zas_ # Date 1208857205 0 # Node ID c9e3baeda1b1ea3d9de3b6cbea6c3846b82b198c # Parent 75b7154e64357c5b99f538d34faaab4f09483208 Correctly escape data before using pango_layout_set_markup(). Exif data may contain characters like & or < >. diff -r 75b7154e6435 -r c9e3baeda1b1 src/image-overlay.c --- a/src/image-overlay.c Tue Apr 22 09:01:29 2008 +0000 +++ b/src/image-overlay.c Tue Apr 22 09:40:05 2008 +0000 @@ -204,7 +204,13 @@ g_free(data); data = new_data; } - + if (data) + { + /* Since we use pango markup to display, we need to escape here */ + gchar *escaped = g_markup_escape_text(data, -1); + g_free(data); + data = escaped; + } g_string_erase(new, pos, end-start+1); if (data) g_string_insert(new, pos, data); @@ -379,7 +385,6 @@ active_marks += fd->marks[mark]; } - if (active_marks > 0) { GString *buf = g_string_sized_new(FILEDATA_MARKS_SIZE * 2); @@ -400,10 +405,12 @@ if (with_hist) { + gchar *escaped_histogram_label = g_markup_escape_text(histogram_label(imd->histogram), -1); if (*text) - text2 = g_strdup_printf("%s\n%s", text, histogram_label(imd->histogram)); + text2 = g_strdup_printf("%s\n%s", text, escaped_histogram_label); else - text2 = g_strdup(histogram_label(imd->histogram)); + text2 = g_strdup(escaped_histogram_label); + g_free(escaped_histogram_label); g_free(text); text = text2; }