diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2019-07-26 11:18:58 +1200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2019-07-29 17:53:13 +0000 |
commit | f58d6cce2a04afaf1c62808a1f75d73e434c3706 (patch) | |
tree | c3ef712d7e1d3d82dc81f3f2d5e44fe3c9c0a051 /gdk-pixbuf | |
parent | 35203978ba650e624f3e06f4436eaf6d8f04da1f (diff) | |
download | gdk-pixbuf-f58d6cce2a04afaf1c62808a1f75d73e434c3706.tar.gz |
gif: Escape GIF version in error message
A corrupt file might have non valid UTF-8 data in the version, so we need to
escape it.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/io-gif.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c index be5bfc235..45cabacba 100644 --- a/gdk-pixbuf/io-gif.c +++ b/gdk-pixbuf/io-gif.c @@ -1167,12 +1167,16 @@ gif_init (GifContext *context) version[3] = '\0'; if ((strcmp (version, "87a") != 0) && (strcmp (version, "89a") != 0)) { + gchar *escaped_version; + /* bad version number, not '87a' or '89a' */ + escaped_version = g_strescape (version, NULL); g_set_error (context->error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Version %s of the GIF file format is not supported"), - version); + escaped_version); + g_free (escaped_version); return -2; } |