diff options
-rw-r--r-- | Build/source/texk/web2c/pmpostdir/ChangeLog | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/pmpostdir/pmpost.ch | 22 |
2 files changed, 17 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/pmpostdir/ChangeLog b/Build/source/texk/web2c/pmpostdir/ChangeLog index 40d4f765d44..5f9af5660ba 100644 --- a/Build/source/texk/web2c/pmpostdir/ChangeLog +++ b/Build/source/texk/web2c/pmpostdir/ChangeLog @@ -1,6 +1,7 @@ 2019-01-29 Akira Kakuto <kakuto@w32tex.org> * pmpost.ch: adapt to the new mpost.w. + Forbid too long kanji option. 2018-12-21 Karl Berry <karl@freefriends.org> diff --git a/Build/source/texk/web2c/pmpostdir/pmpost.ch b/Build/source/texk/web2c/pmpostdir/pmpost.ch index d467528b031..effaa112b18 100644 --- a/Build/source/texk/web2c/pmpostdir/pmpost.ch +++ b/Build/source/texk/web2c/pmpostdir/pmpost.ch @@ -98,9 +98,14 @@ char kanjioption[16]; } else if (ARGUMENT_IS ("interaction")) { @y } else if (ARGUMENT_IS ("kanji")) { - strcpy(kanjioption, optarg); - if(!set_enc_string(optarg, optarg)) { - fprintf(stderr,"Ignoring unknown argument `%s' to --kanji", optarg); + if (optarg) { + if (strlen(optarg) > 15) { + optarg[15] = '\0'; + } + strcpy(kanjioption, optarg); + if (!set_enc_string(optarg, optarg)) { + fprintf(stderr,"Ignoring unknown argument `%s' to --kanji", optarg); + } } } else if (ARGUMENT_IS ("interaction")) { @@ -120,9 +125,14 @@ char kanjioption[16]; } else if (option_is ("progname")) { user_progname = optarg; } else if (option_is ("kanji")) { - strcpy (kanjioption, optarg); - if(!set_enc_string(optarg, optarg)) { - fprintf(stderr,"Ignoring unknown argument `%s' to --kanji", optarg); + if (optarg) { + if (strlen(optarg) > 15) { + optarg[15] = '\0'; + } + strcpy (kanjioption, optarg); + if (!set_enc_string(optarg, optarg)) { + fprintf(stderr,"Ignoring unknown argument `%s' to --kanji", optarg); + } } @z |