pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/putty Don't order function pointers directly....



details:   https://anonhg.NetBSD.org/pkgsrc/rev/221c7893621a
branches:  trunk
changeset: 610635:221c7893621a
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Nov 01 19:32:44 2012 +0000

description:
Don't order function pointers directly. Don't use non-literals as format
strings. Fix return type of intermediate used for return value of
wcrtomb.

diffstat:

 security/putty/distinfo                    |   8 +++++---
 security/putty/patches/patch-terminal.c    |   4 ++--
 security/putty/patches/patch-timing.c      |  28 ++++++++++++++++++++++++++++
 security/putty/patches/patch-unix_gtkwin.c |   4 ++--
 security/putty/patches/patch-unix_uxucs.c  |  13 +++++++++++++
 5 files changed, 50 insertions(+), 7 deletions(-)

diffs (107 lines):

diff -r fac90d450c90 -r 221c7893621a security/putty/distinfo
--- a/security/putty/distinfo   Thu Nov 01 19:30:58 2012 +0000
+++ b/security/putty/distinfo   Thu Nov 01 19:32:44 2012 +0000
@@ -1,13 +1,15 @@
-$NetBSD: distinfo,v 1.12 2012/05/07 01:14:14 dholland Exp $
+$NetBSD: distinfo,v 1.13 2012/11/01 19:32:44 joerg Exp $
 
 SHA1 (putty-0.62.tar.gz) = 5898438614117ee7e3704fc3f30a3c4bf2041380
 RMD160 (putty-0.62.tar.gz) = 48324416005eb4b14654fc9e0e14d39f20971507
 Size (putty-0.62.tar.gz) = 1783106 bytes
 SHA1 (patch-import.c) = c2dc26aa851a326ea89e782ef93ae7bfdc916366
 SHA1 (patch-ldisc.c) = e4dd89bfb2ddcb47aad46cc7c311f424aa6ab6be
-SHA1 (patch-terminal.c) = 48c3c928711bf7f461c0fd66490b0412f165f75b
+SHA1 (patch-terminal.c) = bed37a83bb7afc56ff34d48f8079b37d9db0f948
+SHA1 (patch-timing.c) = b836da7194aa72ac88d94951070dc65f11978703
 SHA1 (patch-unix_Makefile.gtk) = 0ad8226e2ad8e6e40d3eb9ddef4b22e7d07b7895
 SHA1 (patch-unix_gtkfont_c) = 0e57d4f49466ac73fb0d8cc8efb635e6f8a37f44
-SHA1 (patch-unix_gtkwin.c) = ead5e3dea292e6054afa3b9b1a9bc93fc1aff642
+SHA1 (patch-unix_gtkwin.c) = c62d1888b93476972180d14b1fd06d0ab8c8b04b
 SHA1 (patch-unix_uxnet.c) = 50e39093ece97b189da4a736713b59ed72c162d9
+SHA1 (patch-unix_uxucs.c) = c8a2c4a5f0f50a0c87ec643acd7a02f16dba576f
 SHA1 (patch-windows_window.c) = 0c9f4ad5870e63793278d6f04cae88154611e596
diff -r fac90d450c90 -r 221c7893621a security/putty/patches/patch-terminal.c
--- a/security/putty/patches/patch-terminal.c   Thu Nov 01 19:30:58 2012 +0000
+++ b/security/putty/patches/patch-terminal.c   Thu Nov 01 19:32:44 2012 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-terminal.c,v 1.1 2012/02/22 15:27:16 wiz Exp $
+$NetBSD: patch-terminal.c,v 1.2 2012/11/01 19:32:44 joerg Exp $
 
 Make the home/end keys work on BSD servers as well as Linux ones
 
@@ -32,7 +32,7 @@
 +              he = keysym == PK_HOME ? "\x1B[7~" : "\x1B[8~";
 +          else
 +              he = keysym == PK_HOME ? "\x1BOH" : "\x1BOF";
-+          p += sprintf((char *) p, he);
++          p += sprintf((char *) p, "%s", he);
 +          goto done;
 +      }
 +
diff -r fac90d450c90 -r 221c7893621a security/putty/patches/patch-timing.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/putty/patches/patch-timing.c     Thu Nov 01 19:32:44 2012 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-timing.c,v 1.1 2012/11/01 19:32:44 joerg Exp $
+
+--- timing.c.orig      2012-10-30 22:23:57.000000000 +0000
++++ timing.c
+@@ -41,21 +41,10 @@ static int compare_timers(void *av, void
+      * Failing that, compare on the other two fields, just so that
+      * we don't get unwanted equality.
+      */
+-#ifdef __LCC__
+-    /* lcc won't let us compare function pointers. Legal, but annoying. */
+-    {
+-      int c = memcmp(&a->fn, &b->fn, sizeof(a->fn));
+-      if (c < 0)
+-          return -1;
+-      else if (c > 0)
+-          return +1;
+-    }
+-#else    
+-    if (a->fn < b->fn)
++    if ((uintptr_t)a->fn < (uintptr_t)b->fn)
+       return -1;
+-    else if (a->fn > b->fn)
++    else if ((uintptr_t)a->fn > (uintptr_t)b->fn)
+       return +1;
+-#endif
+ 
+     if (a->ctx < b->ctx)
+       return -1;
diff -r fac90d450c90 -r 221c7893621a security/putty/patches/patch-unix_gtkwin.c
--- a/security/putty/patches/patch-unix_gtkwin.c        Thu Nov 01 19:30:58 2012 +0000
+++ b/security/putty/patches/patch-unix_gtkwin.c        Thu Nov 01 19:32:44 2012 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-unix_gtkwin.c,v 1.1 2012/02/22 15:27:17 wiz Exp $
+$NetBSD: patch-unix_gtkwin.c,v 1.2 2012/11/01 19:32:44 joerg Exp $
 
 Make the home/end keys work on BSD servers as well as Linux ones
 
@@ -21,7 +21,7 @@
 +                  he = code == 1 ? "\x1B[7~" : "\x1B[8~";
 +              else
 +                  he = code == 1 ? "\x1BOH" : "\x1BOF";
-+              end = 1 + sprintf(output+1, he);
++              end = 1 + sprintf(output+1, "%s", he);
                goto done;
            }
            if (code) {
diff -r fac90d450c90 -r 221c7893621a security/putty/patches/patch-unix_uxucs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/putty/patches/patch-unix_uxucs.c Thu Nov 01 19:32:44 2012 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-unix_uxucs.c,v 1.1 2012/11/01 19:32:44 joerg Exp $
+
+--- unix/uxucs.c.orig  2012-10-30 22:26:02.000000000 +0000
++++ unix/uxucs.c
+@@ -76,7 +76,7 @@ int wc_to_mb(int codepage, int flags, wc
+       setlocale(LC_CTYPE, "");
+ 
+       while (wclen > 0) {
+-          int i = wcrtomb(output, wcstr[0], &state);
++          size_t i = wcrtomb(output, wcstr[0], &state);
+           if (i == (size_t)-1 || i > n - mblen)
+               break;
+           memcpy(mbstr+n, output, i);



Home | Main Index | Thread Index | Old Index