diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-04 23:25:00 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-08 18:53:00 +0800 |
commit | 2c7a17acdede9bca279aa49653e7ed0eb44e98dc (patch) | |
tree | b129ba87cad4a0659cc84830b6b21a3fff2715d2 /scripts | |
parent | 0c61b5737fd5b8fc03ac1457b2dc85033677e8f0 (diff) | |
download | mupdf-2c7a17acdede9bca279aa49653e7ed0eb44e98dc.tar.xz |
Limit length of fontfile name in fontdump.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/fontdump.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/fontdump.c b/scripts/fontdump.c index dddbac75..8bb7b8a2 100644 --- a/scripts/fontdump.c +++ b/scripts/fontdump.c @@ -73,6 +73,14 @@ main(int argc, char **argv) else basename = argv[i]; + if (strlen(basename) >= sizeof(fontname)) + { + fclose(fi); + fclose(fo); + fprintf(stderr, "fontdump: filename '%s' too long\n", basename); + return 1; + } + strcpy(fontname, basename); for (p = fontname; *p; ++p) { |