diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-13 14:57:11 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-13 14:57:11 +0000 |
commit | 0d92b214c7b84204b9c18a93875516ef48082e0e (patch) | |
tree | 8a974ba90dda04421497483805c0f1920f509483 /Build | |
parent | 4dae4c2de2d28a839e38ee72d2cd7a54ec143d02 (diff) |
Guarantee that mline in is_pdfm_mapline(mline) is a zero-ended string when called by spc_handler_pdfm_mapline().
git-svn-id: svn://tug.org/texlive/trunk@32400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/spc_pdfm.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 41401ea6fa9..fed6611742e 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,8 @@ +2013-12-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * spc_pdfm.c: Guarantee that mline in is_pdfm_mapline(mline) is a + zero-ended string when called by spc_handler_pdfm_mapline(). + 2013-11-28 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * xbb.c: Add suffixes ".ai", ".AI" for the Illustrator files. diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 5d8d827d072..7317f5d3aad 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -1800,6 +1800,8 @@ spc_handler_pdfm_mapline (struct spc_env *spe, struct spc_arg *ap) fontmap_rec *mrec; char *map_name, opchr; int error = 0; + static char buffer[1024]; + char *p, *q; skip_white(&ap->curptr, ap->endptr); if (ap->curptr >= ap->endptr) { @@ -1825,9 +1827,14 @@ spc_handler_pdfm_mapline (struct spc_env *spe, struct spc_arg *ap) } break; case '+': + p = (char *)ap->curptr; + q = buffer; + while (p < ap->endptr) + *q++ = *p++; + *q = '\0'; mrec = NEW(1, fontmap_rec); pdf_init_fontmap_record(mrec); - error = pdf_read_fontmap_line(mrec, ap->curptr, (long) (ap->endptr - ap->curptr), is_pdfm_mapline(ap->curptr)); + error = pdf_read_fontmap_line(mrec, buffer, (long) (ap->endptr - ap->curptr), is_pdfm_mapline(buffer)); if (error) spc_warn(spe, "Invalid fontmap line."); else { @@ -1837,9 +1844,14 @@ spc_handler_pdfm_mapline (struct spc_env *spe, struct spc_arg *ap) RELEASE(mrec); break; default: + p = (char *)ap->curptr; + q = buffer; + while (p < ap->endptr) + *q++ = *p++; + *q = '\0'; mrec = NEW(1, fontmap_rec); pdf_init_fontmap_record(mrec); - error = pdf_read_fontmap_line(mrec, ap->curptr, (long) (ap->endptr - ap->curptr), is_pdfm_mapline(ap->curptr)); + error = pdf_read_fontmap_line(mrec, buffer, (long) (ap->endptr - ap->curptr), is_pdfm_mapline(buffer)); if (error) spc_warn(spe, "Invalid fontmap line."); else { |