summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-11-14 23:28:01 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-11-14 23:28:01 +0000
commit41ee5267cbaddb90070af789cdd52a912a9762c7 (patch)
tree03fe42fb521147328c74f44c603d63a913b0abe8 /gdk-pixbuf
parent5df65643e22d1e0dcbb13d38e43e8d65f27ae777 (diff)
downloadgdk-pixbuf-41ee5267cbaddb90070af789cdd52a912a9762c7.tar.gz
Check that the mask is NULL or a string of the same length consisting
Sat Nov 15 00:26:19 2003 Matthias Clasen <maclas@gmx.de> * queryloaders.c (loader_sanity_check): Check that the mask is NULL or a string of the same length consisting entirely of ' ', '!', 'x', 'z', 'n'.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog6
-rw-r--r--gdk-pixbuf/queryloaders.c23
2 files changed, 27 insertions, 2 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index be50ab86c..e1286f744 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,9 @@
+Sat Nov 15 00:26:19 2003 Matthias Clasen <maclas@gmx.de>
+
+ * queryloaders.c (loader_sanity_check): Check that the mask
+ is NULL or a string of the same length consisting entirely of
+ ' ', '!', 'x', 'z', 'n'.
+
Mon Nov 10 00:17:52 2003 Matthias Clasen <maclas@gmx.de>
* Makefile.am (install-data-local): Typo fix in warning.
diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
index 0e1502a44..41c4c3669 100644
--- a/gdk-pixbuf/queryloaders.c
+++ b/gdk-pixbuf/queryloaders.c
@@ -59,13 +59,32 @@ loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *v
const GdkPixbufModulePattern *pattern;
const char *error = "";
- for (pattern = info->signature; pattern->prefix; pattern++)
- if (strlen (pattern->prefix) == 0)
+ for (pattern = info->signature; pattern->prefix; pattern++)
+ {
+ int prefix_len = strlen (pattern->prefix);
+ if (prefix_len == 0)
{
error = "empty pattern";
goto error;
}
+ if (pattern->mask)
+ {
+ int mask_len = strlen (pattern->mask);
+ if (mask_len != prefix_len)
+ {
+ error = "mask length mismatch";
+
+ goto error;
+ }
+ if (strspn (pattern->mask, " !xzn") < mask_len)
+ {
+ error = "bad char in mask";
+
+ goto error;
+ }
+ }
+ }
if (!vtable->load && !vtable->begin_load && !vtable->load_animation)
{