1 diff --git a/lib/t1lib/parseAFM.c b/lib/t1lib/parseAFM.c
2 index 6a31d7f..ba64541 100644
3 --- a/lib/t1lib/parseAFM.c
4 +++ b/lib/t1lib/parseAFM.c
5 @@ -199,7 +199,9 @@ static char *token(stream)
8 while (ch != EOF && ch != ' ' && ch != CR && ch != LF &&
9 - ch != CTRL_Z && ch != '\t' && ch != ':' && ch != ';'){
10 + ch != CTRL_Z && ch != '\t' && ch != ':' && ch != ';'
11 + && idx < (MAX_NAME -1))
16 @@ -235,7 +237,7 @@ static char *linetoken(stream)
17 while ((ch = fgetc(stream)) == ' ' || ch == '\t' );
20 - while (ch != EOF && ch != CR && ch != LF && ch != CTRL_Z)
21 + while (ch != EOF && ch != CR && ch != LF && ch != CTRL_Z && idx < (MAX_NAME - 1))