diff options
Diffstat (limited to 'pdf/pdf_cmap.c')
-rw-r--r-- | pdf/pdf_cmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c index 05d0d1a28..9799120cb 100644 --- a/pdf/pdf_cmap.c +++ b/pdf/pdf_cmap.c @@ -646,10 +646,10 @@ pdf_cmap_open_file(pdf_context *ctx, gs_string *cmap_name, byte **buf, int64_t * const char *path_pfx = "CMap/"; fname[0] = '\0'; - strncat(fname, path_pfx, strlen(path_pfx)); - if (strlen(fname) + cmap_name->size >= gp_file_name_sizeof) + if (strlen(path_pfx) + cmap_name->size >= gp_file_name_sizeof) return_error(gs_error_rangecheck); + strncat(fname, path_pfx, strlen(path_pfx)); strncat(fname, (char *)cmap_name->data, cmap_name->size); code = pdfi_open_resource_file(ctx, (const char *)fname, (const int)strlen(fname), &s); if (code >= 0) { |