diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-02-26 10:19:50 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-02-26 10:19:50 +0000 |
commit | be3f8d06bdad1466d08e83ab7c3d29d2334d1742 (patch) | |
tree | 4d30d752430e5f25cdd96a2f6178e1bd96e9d4bb /Build/source/texk/dvipsk | |
parent | e464beac115aa718160d470a52c498f146667299 (diff) |
afm2tfm, ttfdump: forbid too long file name
git-svn-id: svn://tug.org/texlive/trunk@50140 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk')
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/afm2tfm.c | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 150c1081c6a..c6ce958c6b4 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,7 @@ +2019-02-26 Hironobu Yamashita <h.y.acetaminophen@gmail.com> + + * afm2tfm.c: Forbid too long file name. + 2019-02-11 Karl Berry <karl@tug.org> * dvips.texi, diff --git a/Build/source/texk/dvipsk/afm2tfm.c b/Build/source/texk/dvipsk/afm2tfm.c index 13240a80b8f..c983dd555b1 100644 --- a/Build/source/texk/dvipsk/afm2tfm.c +++ b/Build/source/texk/dvipsk/afm2tfm.c @@ -210,8 +210,9 @@ struct pcc { }; FILE *afmin, *vplout, *tfmout; -char inname[200], outname[200]; /* names of input and output files */ -char tmpstr[200]; /* a buffer for one string */ +#define MAXNAME 256 +char inname[MAXNAME], outname[MAXNAME]; /* names of input and output files */ +char tmpstr[MAXNAME]; /* a buffer for one string */ #define INBUFSIZE 1024 char buffer[INBUFSIZE+10]; /* input buffer (modified while parsing) */ char obuffer[INBUFSIZE+10]; /* unmodified copy of input buffer */ @@ -1645,6 +1646,8 @@ openfiles(int argc, char **argv) snprintf(titlebuf, sizeof(titlebuf), "%s %s", argv[0], argv[1]); #endif #endif + if(strlen(argv[1]) >= MAXNAME - 4) + error("! too long input file name"); strcpy(inname, argv[1]); #ifdef KPATHSEA if (find_suffix(inname) == NULL) @@ -1667,6 +1670,8 @@ openfiles(int argc, char **argv) case 'V': makevpl++; case 'v': makevpl++; CHECKARG3 + if(strlen(argv[3]) >= MAXNAME - 4) + error("! too long output VPL file name"); strcpy(outname, argv[3]); #ifdef KPATHSEA if (find_suffix(outname) == NULL) |