]> www.fi.muni.cz Git - evince.git/commitdiff
backends: Fix another security issue in the dvi-backend
authorVincent Untz <vuntz@gnome.org>
Thu, 17 Feb 2011 14:23:39 +0000 (15:23 +0100)
committerVincent Untz <vuntz@gnome.org>
Thu, 17 Feb 2011 14:23:39 +0000 (15:23 +0100)
This is similar to one of the fixes from d4139205.

https://bugzilla.gnome.org/show_bug.cgi?id=640923

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);