diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-08-09 12:33:56 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-08-09 16:30:14 +0100 |
commit | 4eaefcce1e330998359c85ee7011dd30f81e2d78 (patch) | |
tree | 88c0b55e16b1069b77d572b31cf2cb42f4be744e /psi | |
parent | b56a8977fc1e3bb88b06b830fdeb9b6622d53d49 (diff) | |
download | ghostpdl-4eaefcce1e330998359c85ee7011dd30f81e2d78.tar.gz |
Bug 705732: Add param and type checking for the .PDFparsePageList operator
Diffstat (limited to 'psi')
-rw-r--r-- | psi/zpdfops.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/psi/zpdfops.c b/psi/zpdfops.c index a8e548c83..48bcbb1d8 100644 --- a/psi/zpdfops.c +++ b/psi/zpdfops.c @@ -1544,7 +1544,15 @@ static int zPDFparsePageList(i_ctx_t *i_ctx_p) int code = 0, size = 0, i; os_ptr op = osp; int *page_range_array; - int num_pages = op->value.intval; + int num_pages; + + check_op(2); + + code = int_param(op, max_int, &num_pages); + if (code < 0) + return code; + + check_type_only(*(op - 1), t_string); code = pagelist_parse_to_array((char *)((op - 1)->value.const_bytes), imemory, num_pages, &page_range_array); make_int(op, 0); /* default return 0 */ |