Index: file.c =================================================================== --- file.c (revision 30797) +++ file.c (revision 30798) @@ -1216,6 +1216,7 @@ { int c, comment_len; int first_element = 1; + long pos = 0; enum { ST_WS, ST_COMMENT, @@ -1226,6 +1227,7 @@ gds_init(&tag); while ((c = fgetc(f)) != EOF) { + if (pos++ > 1024) break; /* header must be in the first kilobyte */ switch (state) { case ST_ELEMENT: if (isspace(c))