]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/mdvi-lib/afmparse.c
backends: Fix another security issue in the dvi-backend
[evince.git] / backend / dvi / mdvi-lib / afmparse.c
index 361e23d6ce1a1ab1d5f36b494966ac53b271ebf4..e1cd1156e8d98a129978309291e56ba47ae70b68 100644 (file)
@@ -190,7 +190,7 @@ static char *linetoken(FILE *stream)
     while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); 
     
     idx = 0;
-    while (ch != EOF && ch != lineterm
+    while (ch != EOF && ch != lineterm && idx < MAX_NAME)
     {
         ident[idx++] = ch;
         ch = fgetc(stream);