From: Scott Reeves Date: Sun, 20 Mar 2011 10:01:07 +0000 (+0100) Subject: dvi: Another fix for buffer overwrite in dvi-backend X-Git-Tag: EVINCE_2_91_92~15 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=efadec4ffcdde3373f6f4ca0eaac98dc963c4fd5;p=evince.git dvi: Another fix for buffer overwrite in dvi-backend https://bugzilla.gnome.org/show_bug.cgi?id=643882 --- diff --git a/backend/dvi/mdvi-lib/afmparse.c b/backend/dvi/mdvi-lib/afmparse.c index e1cd1156..f90e5575 100644 --- a/backend/dvi/mdvi-lib/afmparse.c +++ b/backend/dvi/mdvi-lib/afmparse.c @@ -160,7 +160,7 @@ static char *token(FILE *stream) idx = 0; while (ch != EOF && ch != ' ' && ch != lineterm - && ch != '\t' && ch != ':' && ch != ';' && idx < MAX_NAME) + && ch != '\t' && ch != ':' && ch != ';' && idx < (MAX_NAME - 1)) { ident[idx++] = ch; ch = fgetc(stream); @@ -190,7 +190,7 @@ static char *linetoken(FILE *stream) while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); idx = 0; - while (ch != EOF && ch != lineterm && idx < MAX_NAME) + while (ch != EOF && ch != lineterm && idx < (MAX_NAME - 1)) { ident[idx++] = ch; ch = fgetc(stream);