summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2017-09-28 18:04:20 -0600
committerChris Liddell <chris.liddell@artifex.com>2017-10-03 08:42:11 +0100
commit3c2974bcd2e638be13c0ec814342a1a35ca0872b (patch)
treef7aec212c3c9d8af863ffa8de302f8249b6fdfd3
parentf1d39c92bff2de2d7b270a419a907c935ea626a6 (diff)
downloadghostpdl-3c2974bcd2e638be13c0ec814342a1a35ca0872b.tar.gz
Fix buffer overflow regression.
The commit to address 694653 (3749bc274) was incorrect, the font_data_size variable is not necessarily the size of the buffer.
-rw-r--r--pcl/pcl/pcsfont.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcl/pcl/pcsfont.c b/pcl/pcl/pcsfont.c
index 320d506e2..7c995806a 100644
--- a/pcl/pcl/pcsfont.c
+++ b/pcl/pcl/pcsfont.c
@@ -548,8 +548,9 @@ pcl_character_data(pcl_args_t * pargs, pcl_state_t * pcs)
return e_Unimplemented;
}
/* check for buffer overrun */
- if (pcs->soft_font_count + count - 2 > font_data_size)
+ if (pcs->soft_font_count + count - 2 > gs_object_size(pcs->memory, pcs->soft_font_char_data))
return e_Range;
+
/* append the new data to the new object */
memcpy(pcs->soft_font_char_data + pcs->soft_font_count, data + 2,
count - 2);