[76018] trunk/dports/net/tf

jmr at macports.org jmr at macports.org
Wed Feb 16 02:36:09 PST 2011


Revision: 76018
          http://trac.macports.org/changeset/76018
Author:   jmr at macports.org
Date:     2011-02-16 02:36:06 -0800 (Wed, 16 Feb 2011)
Log Message:
-----------
tf: fix crash due to incorrect use of vsprintf (#23064)

Modified Paths:
--------------
    trunk/dports/net/tf/Portfile

Added Paths:
-----------
    trunk/dports/net/tf/files/amd64_vSprintf_fix.patch

Modified: trunk/dports/net/tf/Portfile
===================================================================
--- trunk/dports/net/tf/Portfile	2011-02-16 08:25:36 UTC (rev 76017)
+++ trunk/dports/net/tf/Portfile	2011-02-16 10:36:06 UTC (rev 76018)
@@ -4,7 +4,7 @@
 
 name            tf
 version         5.0b8
-revision        1
+revision        2
 categories      net games
 maintainers     gmail.com:darren.bane
 description     popular and powerful MUD client
@@ -26,7 +26,8 @@
                 --enable-termcap=ncurses \
                 --disable-ssl
 
-patchfiles      patch-src-malloc.c.diff patch-src__signals.c patch-src__socket.c
+patchfiles      patch-src-malloc.c.diff patch-src__signals.c \
+                patch-src__socket.c amd64_vSprintf_fix.patch
 
 post-configure {
     system "ed - ${worksrcpath}/src/tfconfig.h < ${filespath}/tfconfig.h.ed"

Added: trunk/dports/net/tf/files/amd64_vSprintf_fix.patch
===================================================================
--- trunk/dports/net/tf/files/amd64_vSprintf_fix.patch	                        (rev 0)
+++ trunk/dports/net/tf/files/amd64_vSprintf_fix.patch	2011-02-16 10:36:06 UTC (rev 76018)
@@ -0,0 +1,30 @@
+diff -U5 -r tf-50b8.orig/src/tfio.c tf-50b8/src/tfio.c
+--- src/tfio.c.orig	2007-01-13 18:12:39.000000000 -0500
++++ src/tfio.c	2007-02-02 16:50:12.000000000 -0500
+@@ -495,10 +495,11 @@
+     const char *q, *sval;
+     char *specptr, quote;
+     const conString *Sval;
+     int len, min, max, leftjust, stars;
+     attr_t attrs = buf->attrs;
++    va_list aq;
+ 
+     if (!(flags & SP_APPEND) && buf->data) Stringtrunc(buf, 0);
+     while (*fmt) {
+         if (*fmt != '%' || *++fmt == '%') {
+             for (q = fmt + 1; *q && *q != '%'; q++);
+@@ -520,11 +521,13 @@
+         switch (*fmt) {
+         case 'd': case 'i':
+         case 'x': case 'X': case 'u': case 'o':
+         case 'f': case 'e': case 'E': case 'g': case 'G':
+         case 'p':
+-            vsprintf(tempbuf, spec, ap);
++            va_copy(aq, ap);
++            vsprintf(tempbuf, spec, aq);
++            va_end(aq);
+             Stringcat(buf, tempbuf);
+             /* eat the arguments used by vsprintf() */
+             while (stars--) (void)va_arg(ap, int);
+             switch (*fmt) {
+             case 'd': case 'i':
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110216/7f56f298/attachment-0001.html>


More information about the macports-changes mailing list