Check for overflow. (#306394, Morten Welinder)

2005-06-08  Matthias Clasen  <mclasen@redhat.com>

	* io-pnm.c (pnm_read_next_value): Check for overflow.
	(#306394, Morten Welinder)
This commit is contained in:
Matthias Clasen
2005-06-08 20:58:25 +00:00
committed by Matthias Clasen
parent 0f440a3d4c
commit 36c4c40f88
2 changed files with 6 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2005-06-08 Matthias Clasen <mclasen@redhat.com>
* io-pnm.c (pnm_read_next_value): Check for overflow.
(#306394, Morten Welinder)
2005-04-29 Matthias Clasen <mclasen@redhat.com>
* Makefile.am: Use $(NM), not nm directly. (#301299,

View File

@@ -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,