From 99b07a5bc43bd20493c249314aa7f1ef3f38665d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 23 Jan 2018 15:31:08 +0100 Subject: Return error token if strings are unterminated. --- source/pdf/pdf-lex.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source') 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"); } -- cgit v1.2.3