diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-09-27 11:07:11 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-09-27 11:07:11 +0000 |
commit | 85463589439beed5b0eadb26ee1d053349c198f0 (patch) | |
tree | 97eb24699da6eeb832acb0d7831a1e25cf1d0ef6 | |
parent | 26dde332a5810fa9d36bb94a12df15d974e327d2 (diff) | |
download | mupdf-85463589439beed5b0eadb26ee1d053349c198f0.tar.xz |
Validate xref entry type (f, n, o) when reading xref table.
-rw-r--r-- | mupdf/pdf_xref.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mupdf/pdf_xref.c b/mupdf/pdf_xref.c index 1d7dbc3a..96534845 100644 --- a/mupdf/pdf_xref.c +++ b/mupdf/pdf_xref.c @@ -247,6 +247,8 @@ pdf_readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap) xref->table[i].ofs = atoi(s); xref->table[i].gen = atoi(s + 11); xref->table[i].type = s[17]; + if (s[17] != 'f' && s[17] != 'n' && s[17] != 'o') + return fz_throw("unexpected xref type: %#x (%d %d R)", s[17], i, xref->table[i].gen); } } } |