--- tetex-src-3.0/texk/dvipsk/virtualfont.c.orig	2010-03-28 09:07:31.000000000 +0900
+++ tetex-src-3.0/texk/dvipsk/virtualfont.c	2010-03-28 09:17:20.000000000 +0900
@@ -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
 /*
  *   These are the external routines we use.
@@ -36,12 +37,12 @@
  *   Subroutine vfbyte returns the next byte.
  */
 static FILE *vffile ;
-static char name[50] ;
+static char name[500] ;
 void
 badvf P1C(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
@@ -93,6 +94,10 @@
    if (*d==0)
       d = vfpath ;
 #endif
+   if (strlen(n) + 5 >= sizeof (name)) {
+     /* 5 for vf() + null */
+     error("! VF file name too long in vfopen") ;
+   }
 #ifdef MVSXA   /* IBM: MVS/XA */
    (void)sprintf(name, "vf(%s)", n) ;
 #else
@@ -223,8 +228,8 @@
    k = (integer)(alpha * (real)vfquad()) ;
    if ((id != 9 && id != 11) &&
        (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.
