Commit e99a8c00 authored by Felix Riemann's avatar Felix Riemann

EogErrorMessageArea: Make sure error messages are valid UTF8

GMarkup requires valid UTF8 input strings and would cause odd
looking messages if given invalid input. This could also trigger an
out-of-bounds write in glib before 2.44.1. Reported by kaslovdmitri.

https://bugzilla.gnome.org/show_bug.cgi?id=770143
parent 55036c6d
......@@ -28,6 +28,7 @@
#include "eog-error-message-area.h"
#include "eog-image.h"
#include "eog-util.h"
#include <glib.h>
#include <glib/gi18n.h>
......@@ -218,7 +219,7 @@ eog_image_load_error_message_area_new (const gchar *caption,
error_message = g_strdup_printf (_("Could not load image '%s'."),
pango_escaped_caption);
message_details = g_strdup (error->message);
message_details = eog_util_make_valid_utf8 (error->message);
message_area = create_error_message_area (error_message,
message_details,
......@@ -260,7 +261,7 @@ eog_image_save_error_message_area_new (const gchar *caption,
error_message = g_strdup_printf (_("Could not save image '%s'."),
pango_escaped_caption);
message_details = g_strdup (error->message);
message_details = eog_util_make_valid_utf8 (error->message);
message_area = create_error_message_area (error_message,
message_details,
......
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