Skip to content

Commit

Permalink
[tx] allocate byte for null terminator when copying PostScript strings
Browse files Browse the repository at this point in the history
(Note that `STRCPY_S` is currently mapped to `strcpy` on mac, so the size parameter is not used there.)
  • Loading branch information
cjchapman committed Sep 16, 2019
1 parent d4fce3f commit 99ddd62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c/public/lib/source/cffwrite/cffwrite_dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void saveFSType(cfwCtx g, abfTopDict *dst) {
}
/* Copy string to tmp buf */
/* 64-bit warning fixed by cast here */
postscriptLen = strlen(dst->PostScript.ptr);
postscriptLen = strlen(dst->PostScript.ptr) + 1;
STRCPY_S(dnaEXTEND(h->tmp, (long)postscriptLen),
postscriptLen,
dst->PostScript.ptr);
Expand Down Expand Up @@ -159,7 +159,7 @@ static void saveOrigFontType(cfwCtx g, abfTopDict *dst) {
}
/* Copy string to tmp buf */
/* 64-bit warning fixed by cast here */
postscriptLen = strlen(dst->PostScript.ptr);
postscriptLen = strlen(dst->PostScript.ptr) + 1;
STRCPY_S(dnaEXTEND(h->tmp, (long)postscriptLen),
postscriptLen,
dst->PostScript.ptr);
Expand Down

0 comments on commit 99ddd62

Please sign in to comment.