diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 8c5a67afaf..cfbb79e221 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2005-06-08 Matthias Clasen + + * io-pnm.c (pnm_read_next_value): Check for overflow. + (#306394, Morten Welinder) + 2005-04-29 Matthias Clasen * Makefile.am: Use $(NM), not nm directly. (#301299, diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c index b568b4bccc..81e50a7f79 100644 --- a/gdk-pixbuf/io-pnm.c +++ b/gdk-pixbuf/io-pnm.c @@ -245,7 +245,7 @@ pnm_read_next_value (PnmIOBuffer *inbuf, gint max_length, guint *value, GError * /* get the value */ result = strtol (buf, &endptr, 10); - if (*endptr != '\0' || result < 0) { + if (*endptr != '\0' || result < 0 || result > G_MAXUINT) { g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE,