diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-02-24 08:35:18 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-02-24 08:35:18 +0000 |
commit | 035e1d6c41a8243f0ee387c06f142f5d266fda9a (patch) | |
tree | 85b0880b83c92fe74723df38e26128e1ba0e7f57 /Build/source/texk/dvipdfm-x/dvi.c | |
parent | fc6cfa0b756f94ceb9dabd6eb562803886ddd6fd (diff) |
texk/dvipdfm-x: Bug fix - avoid sprintf() buffer overflow
git-svn-id: svn://tug.org/texlive/trunk@36365 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dvi.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index 61fca5f6b1a..f0dd4393d0c 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -921,7 +921,7 @@ dvi_locate_native_font (const char *filename, uint32_t index, { int cur_id = -1; fontmap_rec *mrec; - char *fontmap_key = malloc(strlen(filename) + 40); // CHECK this is enough + char *fontmap_key; FILE *fp; char *path = strdup(filename); sfnt *sfont; @@ -948,6 +948,7 @@ dvi_locate_native_font (const char *filename, uint32_t index, cur_id = num_loaded_fonts++; + fontmap_key = malloc(strlen(path) + 40); // CHECK this is enough sprintf(fontmap_key, "%s/%u/%c/%d/%d/%d", path, index, layout_dir == 0 ? 'H' : 'V', extend, slant, embolden); mrec = pdf_lookup_fontmap_record(fontmap_key); if (mrec == NULL) { |