From bedb98a87a38a64b67d9a27e08b459dd216b2de9 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 20 Mar 2018 12:49:50 +0800 Subject: Fix 699130: Handle missing arguments in directives in mutool create. --- source/tools/pdfcreate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c index 032f32d5..aa0e246e 100644 --- a/source/tools/pdfcreate.c +++ b/source/tools/pdfcreate.c @@ -165,16 +165,22 @@ static void create_page(char *input) { s = fz_strsep(&p, " "); t = fz_strsep(&p, " "); + if (!s || !t || !p) + fz_throw(ctx, FZ_ERROR_GENERIC, "Font directive missing arguments"); add_font_res(resources, s, t, p); } else if (!strcmp(s, "%%CJKFont")) { s = fz_strsep(&p, " "); + if (!s || !p) + fz_throw(ctx, FZ_ERROR_GENERIC, "CJKFont directive missing arguments"); add_cjkfont_res(resources, s, p); } else if (!strcmp(s, "%%Image")) { s = fz_strsep(&p, " "); + if (!s || !p) + fz_throw(ctx, FZ_ERROR_GENERIC, "Image directive missing arguments"); add_image_res(resources, s, p); } } -- cgit v1.2.3