diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2018-01-21 21:08:07 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2018-01-22 18:16:28 +0100 |
commit | 22339500c243e564eadf564b5ae2925e1caf44a9 (patch) | |
tree | b1e752265af8b107f586b8411de782131f8d50d7 | |
parent | 11ee2bcf4d23bcb443d6b39caa2ac62fdd9920b2 (diff) | |
download | mupdf-22339500c243e564eadf564b5ae2925e1caf44a9.tar.xz |
Bug 698889: Handle unterminated PDF arrays gracefully.
Thanks to oss-fuzz for reporting this.
-rw-r--r-- | source/pdf/pdf-parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c index ff741dcb..7904ebd7 100644 --- a/source/pdf/pdf-parse.c +++ b/source/pdf/pdf-parse.c @@ -401,6 +401,9 @@ pdf_parse_array(fz_context *ctx, pdf_document *doc, fz_stream *file, pdf_lexbuf switch (tok) { + case PDF_TOK_EOF: + fz_throw(ctx, FZ_ERROR_SYNTAX, "array not closed before end of file"); + case PDF_TOK_CLOSE_ARRAY: op = ary; goto end; |