summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttfdump
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/ttfdump
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/ttfdump')
-rw-r--r--Build/source/texk/ttfdump/ChangeLog4
-rw-r--r--Build/source/texk/ttfdump/src/ttfdump.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/Build/source/texk/ttfdump/ChangeLog b/Build/source/texk/ttfdump/ChangeLog
index 31598be70e8..b82e45c40c9 100644
--- a/Build/source/texk/ttfdump/ChangeLog
+++ b/Build/source/texk/ttfdump/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-26 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * src/ttfdump.c: Forbid too long file name.
+
2017-06-24 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* src/ttfdump.c: allow a suffix .TTC for ttc fonts.
diff --git a/Build/source/texk/ttfdump/src/ttfdump.c b/Build/source/texk/ttfdump/src/ttfdump.c
index 50315f12ee9..0e8722b4941 100644
--- a/Build/source/texk/ttfdump/src/ttfdump.c
+++ b/Build/source/texk/ttfdump/src/ttfdump.c
@@ -117,9 +117,17 @@ main(int argc, char *argv[])
collection = atoi(optarg);
break;
case 'i':
+ if(strlen(optarg) >= MAXLEN) {
+ fprintf(stderr, "Too long input file name\n");
+ exit(EXIT_FAILURE);
+ }
strcpy(ttfname, optarg);
break;
case 'o':
+ if(strlen(optarg) >= MAXLEN) {
+ fprintf(stderr, "Too long output file name\n");
+ exit(EXIT_FAILURE);
+ }
strcpy(dumpname, optarg);
break;
case 'h':
@@ -133,6 +141,10 @@ main(int argc, char *argv[])
/* processing ttf file if -i flag is not given */
if (*ttfname == 0 && optind < argc)
{
+ if(strlen(argv[optind]) >= MAXLEN) {
+ fprintf(stderr, "Too long input file name\n");
+ exit(EXIT_FAILURE);
+ }
strcpy(ttfname, argv[optind]);
}