summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 02:11:02 +0100
committerinfirit <[email protected]>2014-12-10 02:11:02 +0100
commitbf6e3391b82844e8b6aec0f26332b9e2df41edf8 (patch)
treed15a647e332f97f5f4e9fd10fe7fc1ad4a371db1
parent8d384f7cfcb9a6f1692c81c703c0d9e636683e13 (diff)
downloadatril-bf6e3391b82844e8b6aec0f26332b9e2df41edf8.tar.bz2
atril-bf6e3391b82844e8b6aec0f26332b9e2df41edf8.tar.xz
dvi: Another fix for buffer overwrite in dvi-backend
Taken from evince commit: efadec4ffcdde3373f6f4ca0eaac98dc963c4fd5 From: Scott Reeves <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=643882
-rw-r--r--backend/dvi/mdvi-lib/afmparse.c4
1 files changed, 2 insertions, 2 deletions
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);