diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2021-08-17 08:46:00 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2021-08-17 09:33:50 +0100 |
commit | 90cd407091a83700091d207797557d88fff97159 (patch) | |
tree | db1df6254b5526874c843ad2fba0f4b72984d49a | |
parent | 3c01ce0af1de445bddee8e9b74710c01fff6b97b (diff) | |
download | ghostpdl-90cd407091a83700091d207797557d88fff97159.tar.gz |
Coverity ID 372266: Validate charstrings index size
-rw-r--r-- | pdf/pdf_font1C.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_font1C.c b/pdf/pdf_font1C.c index f3527ff8d..f77a52bb1 100644 --- a/pdf/pdf_font1C.c +++ b/pdf/pdf_font1C.c @@ -1622,7 +1622,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv) /* Check the charstrings index */ if (font->charstrings) { p = pdfi_count_cff_index(font->charstrings, e, &font->ncharstrings); - if (!p) + if (!p || font->ncharstrings > 65535) return gs_rethrow(-1, "cannot read charstrings index"); } code = pdfi_object_alloc(ctx, PDF_DICT, font->ncharstrings, (pdf_obj **) &font->CharStrings); |