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 | |
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')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 3 | ||||
-rwxr-xr-x | Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index fceb813f3c4..e03a2b29c33 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,7 @@ +2015-02-24 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvi.c (dvi_locate_native_font): Avoid buffer overflow. + 2015-02-21 Khaled Hosny <khaledhosny@eglug.org> * dvi.c (dvi_locate_font, dvi_locate_native_font): make sure the 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) { diff --git a/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test b/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test index 24e044d2393..a718b30641b 100755 --- a/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test +++ b/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org> +# Copyright (C) 2015 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. TEXMFCNF=$srcdir/../kpathsea @@ -9,18 +9,17 @@ T1FONTS="$srcdir/tests;$srcdir/data" TTFONTS="$srcdir/tests;$srcdir/data" TEXFONTMAPS="$srcdir/tests;$srcdir/data" DVIPDFMXINPUTS="$srcdir/tests;$srcdir/data" -TEXPICTS=$srcdir/tests -export TEXMFCNF TFMFONTS T1FONTS TEXFONTMAPS DVIPDFMXINPUTS TEXPICTS +export TEXMFCNF TFMFONTS T1FONTS TTFONTS TEXFONTMAPS DVIPDFMXINPUTS failed= echo "*** xdvipdfmx -v -z0 -o ttc2.pdf ttc" && echo \ - && ./xdvipdfmx -z0 -o ttc2.pdf $srcdir/tests/ttc \ + && ./xdvipdfmx -v -z0 -o ttc2.pdf $srcdir/tests/ttc \ && echo && echo "xdvipdfmx-ttc tests OK" && echo \ || failed="$failed xdvipdfmx-ttc" test -z "$failed" && exit 0 echo echo "failed tests:$failed" -exit 77 +exit 1 |