[tex-live] (x)dvipdfmx bug-fix

Jonathan Kew jonathan at jfkew.plus.com
Thu Aug 7 23:32:00 CEST 2008


In addition to the recent xetex bug-fix, I have just checked in a fix  
for xdvipdfmx to resolve a stack-smashing (buffer overflow) issue that  
could arise when printing warnings about unrecognized \special  
commands (svn r.10149), if the special contained non-ASCII characters.

ChoF, this affects the original dvipdfmx as well as xdvipdfmx, as it  
is in the print_error routine from dvipdfmx. I have taken the liberty  
of applying the fix to dvipdfmx in texlive as well; here is the change  
I made:

Index: dvipdfmx/src/specials.c
===================================================================
--- dvipdfmx/src/specials.c	(revision 10148)
+++ dvipdfmx/src/specials.c	(working copy)
@@ -530,7 +530,7 @@
      if (isprint(*p))
        ebuf[i++] = *p;
      else if (i + 4 < 63)
-      i += sprintf(ebuf + i, "\\x%02x", *p);
+      i += sprintf(ebuf + i, "\\x%02x", (unsigned char)*p);
      else
        break;
    }
@@ -546,7 +546,7 @@
        if (isprint(*p))
          ebuf[i++] = *p;
        else if (i + 4 < 63)
-        i += sprintf(ebuf + i, "\\x%02x", *p);
+        i += sprintf(ebuf + i, "\\x%02x", (unsigned char)*p);
        else
          break;
      }


Please verify that it is OK, and apply to the upstream dvipdfmx  
sources. Thanks.

Jonathan



More information about the tex-live mailing list