From 0e7ede903608e1d726ccefbfc8a6749e15ab8ed9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 17 May 2004 03:07:23 +0000 Subject: [PATCH] Don't read integers partially. (#142584, Kouichirou Hiratsuka) Sun May 16 22:55:49 2004 Matthias Clasen * io-pnm.c (pnm_read_next_value): Don't read integers partially. (#142584, Kouichirou Hiratsuka) --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/io-pnm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index b8acb85d6c..12b67344cb 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +Sun May 16 22:55:49 2004 Matthias Clasen + + * io-pnm.c (pnm_read_next_value): Don't read integers + partially. (#142584, Kouichirou Hiratsuka) + 2004-05-10 Matthias Clasen * pixops/timescale.c: diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c index 437ccaf0e0..39b7d36337 100644 --- a/gdk-pixbuf/io-pnm.c +++ b/gdk-pixbuf/io-pnm.c @@ -237,7 +237,7 @@ pnm_read_next_value (PnmIOBuffer *inbuf, guint *value, GError **error) *word = '\0'; /* hmmm, there must be more data to this 'word' */ - if (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128)) + if (p == inend || (!g_ascii_isspace (*p) && (*p != '#') && (p - inptr < 128))) return PNM_SUSPEND; /* get the value */