diff options
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvipdfmx.c | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index b807dd32795..532be677e40 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,8 @@ +2021-03-14 Akira Kakuto <kakuto@w32tex.org> + + * dvipdfmx.c: Do not allow directory separators in an optarg + in an option -i optarg for security reason. + 2021-03-05 Akira Kakuto <kakuto@w32tex.org> * pdfdev.c: Correct the incomplete fix on 2021-03-04. diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.c b/Build/source/texk/dvipdfm-x/dvipdfmx.c index f56c1d44ed3..3a4dfa35364 100644 --- a/Build/source/texk/dvipdfm-x/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/dvipdfmx.c @@ -614,8 +614,19 @@ do_args_second_pass (int argc, char *argv[], const char *source, int unsafe) case 'i': { +/* + -i ./foo.cfg, -i /usr/abc/foo.cfg, etc. are not allowed for + security reason. +*/ + char *dir1, *dir2; int optind_save= optind; - read_config_file(optarg); + dir1 = strrchr(optarg, '/'); + dir2 = strrchr(optarg, '\\'); + if (dir1 || dir2) { + WARN("%s is not allowed. Default configuration file is used.", optarg); + } else { + read_config_file(optarg); + } optind = optind_save; break; } |