summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-pnm.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-06-04 20:31:51 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-06-04 20:31:51 +0000
commit47af28acacbdd63dd0330ac5762be788f061dc95 (patch)
treeb434fae0d76125e9bf3a13898bdd449d74f239ae /gdk-pixbuf/io-pnm.c
parenta6eec2785d1099e4716dcd1e3de21b06f6d01804 (diff)
downloadgtk+-47af28acacbdd63dd0330ac5762be788f061dc95.tar.gz
patch from Szekeres Istvan, bug #52560
2001-06-04 Havoc Pennington <hp@redhat.com> * io-pnm.c (pnm_skip_whitespace): patch from Szekeres Istvan, bug #52560
Diffstat (limited to 'gdk-pixbuf/io-pnm.c')
-rw-r--r--gdk-pixbuf/io-pnm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c
index cd7dd9d9bd..dfa5cb3467 100644
--- a/gdk-pixbuf/io-pnm.c
+++ b/gdk-pixbuf/io-pnm.c
@@ -195,7 +195,14 @@ pnm_skip_whitespace (PnmIOBuffer *inbuf, GError **error)
for ( ; inptr < inend; inptr++) {
if (*inptr == '#') {
/* in comment - skip to the end of this line */
- for ( ; *inptr != '\n' && inptr < inend; inptr++);
+ for ( ; *inptr != '\n' && inptr < inend; inptr++)
+ ;
+
+ if ( *inptr != '\n' ) {
+ /* couldn't read whole comment */
+ return PNM_SUSPEND;
+ }
+
} else if (!isspace (*inptr)) {
inbuf->byte = inptr;
inbuf->nbytes = (guint) (inend - inptr);