diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-01-23 15:31:08 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-01-31 12:09:42 +0100 |
commit | 99b07a5bc43bd20493c249314aa7f1ef3f38665d (patch) | |
tree | b72326c3e2b235fee8aa47538dd0b5921f1318dc | |
parent | 03dee17a4f84ee521f64778bb7441accb42e35b9 (diff) | |
download | mupdf-99b07a5bc43bd20493c249314aa7f1ef3f38665d.tar.xz |
Return error token if strings are unterminated.
-rw-r--r-- | source/pdf/pdf-lex.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/pdf/pdf-lex.c b/source/pdf/pdf-lex.c index 1301c64a..d02789a8 100644 --- a/source/pdf/pdf-lex.c +++ b/source/pdf/pdf-lex.c @@ -303,7 +303,7 @@ lex_string(fz_context *ctx, fz_stream *f, pdf_lexbuf *lb) switch (c) { case EOF: - goto end; + return PDF_TOK_ERROR; case '(': bal++; *s++ = c; @@ -319,7 +319,7 @@ lex_string(fz_context *ctx, fz_stream *f, pdf_lexbuf *lb) switch (c) { case EOF: - goto end; + return PDF_TOK_ERROR; case 'n': *s++ = '\n'; break; @@ -414,8 +414,9 @@ lex_hex_string(fz_context *ctx, fz_stream *f, pdf_lexbuf *lb) } break; case '>': - case EOF: goto end; + case EOF: + return PDF_TOK_ERROR; default: fz_warn(ctx, "ignoring invalid character in hex string"); } |