diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipsk/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/dvipsk/virtualfont.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index acd0592af89..2ed06264265 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,5 +1,9 @@ 2010-03-26 Karl Berry <karl@tug.org> + * virtualfont.c (badvf, virtualfont): use concat[n] instead of + sprintf for error messages. + (<kpathsea/concatn.h>): #include. + * virtualfont.c (vfopen): do not sprintf too long of a name. CVE-2010-0827, found by Dan Rosenberg. diff --git a/Build/source/texk/dvipsk/virtualfont.c b/Build/source/texk/dvipsk/virtualfont.c index eb1ffc4ad3c..b38c0b16d11 100644 --- a/Build/source/texk/dvipsk/virtualfont.c +++ b/Build/source/texk/dvipsk/virtualfont.c @@ -5,6 +5,7 @@ #include "dvips.h" /* The copyright notice in that file is included too! */ #ifdef KPATHSEA #include <kpathsea/c-pathmx.h> +#include <kpathsea/concatn.h> #endif /* * The external declarations: @@ -19,8 +20,8 @@ static char name[500] ; void badvf(const char *s) { - (void)sprintf(errbuf,"! Bad VF file %s: %s",name,s) ; - error(errbuf); + char *msg = concatn("! Bad VF file ", name, ":", s); + error(msg); } shalfword @@ -195,8 +196,8 @@ virtualfont(register fontdesctype *curfnt) check_checksum (k, curfnt->checksum, curfnt->name); k = (integer)(alpha * (real)vfquad()) ; if (k > curfnt->designsize + 2 || k < curfnt->designsize - 2) { - (void)sprintf(errbuf,"Design size mismatch in font %s", name) ; - error(errbuf) ; + char *msg = concat("Design size mismatch in font ", name); + error(msg); } /* * Now we look for font definitions. |