Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 30797) +++ trunk/src_plugins/io_kicad/read.c (revision 30798) @@ -2878,6 +2878,7 @@ { int c, comment_len; int first_module = 1; + long pos = 0; enum { ST_WS, ST_COMMENT, @@ -2885,6 +2886,7 @@ } state = ST_WS; while ((c = fgetc(f)) != EOF) { + if (pos++ > 1024) break; /* header must be in the first kilobyte */ switch (state) { case ST_MODULE: if (isspace(c)) Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 30797) +++ trunk/src_plugins/io_lihata/read.c (revision 30798) @@ -2594,6 +2594,7 @@ gds_init(&tag); while ((c = fgetc(f)) != EOF) { pos++; + if (pos > 1024) break; /* header must be in the first kilobyte */ switch (state) { case ST_WS: if (isspace(c)) Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 30797) +++ trunk/src_plugins/io_pcb/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))