summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/afm2tfm.c
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2019-02-26 10:19:50 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2019-02-26 10:19:50 +0000
commitbe3f8d06bdad1466d08e83ab7c3d29d2334d1742 (patch)
tree4d30d752430e5f25cdd96a2f6178e1bd96e9d4bb /Build/source/texk/dvipsk/afm2tfm.c
parente464beac115aa718160d470a52c498f146667299 (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/afm2tfm.c')
-rw-r--r--Build/source/texk/dvipsk/afm2tfm.c9
1 files changed, 7 insertions, 2 deletions
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)