summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-07-26 20:34:13 +0000
committerKristian Høgsberg <krh@redhat.com>2005-07-26 20:34:13 +0000
commit2bc26dffd9f296799617d319055648c20f748c8a (patch)
tree948c176c04172dfdfc1e51d0409663878c66198e /fofi
parent07911274e4e850a628b1e587cafc2a73c05f93fe (diff)
2005-07-26 Kristian Høgsberg <krh@redhat.com>
* fofi/FoFiType1.cc: Make check for end of encoding array a bit more liberal so we don't crash on complex encoding arrays (#3344).
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiType1.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 16a91685..6c5ed3d9 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -186,20 +186,13 @@ void FoFiType1::parse() {
}
}
}
- } else {
- p = strtok(buf, " \t\n\r");
- if (p) {
- if (!strcmp(p, "def"))
- break;
- if (!strcmp(p, "readonly"))
- break;
- /* the spec does not says this but i'm mantaining old xpdf behaviour
- * that accepts "foo def" as end of the encoding array */
- p = strtok(NULL, " \t\n\r");
- if (p && !strcmp(p, "def"))
- break;
- }
- }
+ }
+
+ // Any line that begins with "def" or contains " def"
+ // terminates the encoding array.
+ if (!strcmp (p, "def") || strstr (buf, " def"))
+ break;
+
line = line1;
}
//~ check for getinterval/putinterval junk