summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/afm2tfm.c
diff options
context:
space:
mode:
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)