pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/xmftp Fixed invalid lvalue cast and reminded the p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/72122a1d4a31
branches:  trunk
changeset: 536025:72122a1d4a31
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Dec 01 13:39:05 2007 +0000

description:
Fixed invalid lvalue cast and reminded the programmers that the return
value of sscanf needs to be checked.

diffstat:

 net/xmftp/distinfo         |   4 ++--
 net/xmftp/patches/patch-ac |  28 ++++++++++++++++++++++++----
 2 files changed, 26 insertions(+), 6 deletions(-)

diffs (64 lines):

diff -r e7ac8f51e5ee -r 72122a1d4a31 net/xmftp/distinfo
--- a/net/xmftp/distinfo        Sat Dec 01 13:23:14 2007 +0000
+++ b/net/xmftp/distinfo        Sat Dec 01 13:39:05 2007 +0000
@@ -1,11 +1,11 @@
-$NetBSD: distinfo,v 1.4 2007/07/28 01:30:01 joerg Exp $
+$NetBSD: distinfo,v 1.5 2007/12/01 13:39:05 rillig Exp $
 
 SHA1 (xmftp-1.0.4.tar.gz) = c39b14cabced594a045def93e363a9a6eb069b0b
 RMD160 (xmftp-1.0.4.tar.gz) = 0d31d84430292d71951df78770552be61eb199a3
 Size (xmftp-1.0.4.tar.gz) = 152614 bytes
 SHA1 (patch-aa) = 455222cbb7396d87844f44acbc2203c36b580952
 SHA1 (patch-ab) = c6f54a9ba8b3af66b6da0f04618f6a0d41828245
-SHA1 (patch-ac) = c060df8258065fb8b045a8648aa0de0fd1d9082a
+SHA1 (patch-ac) = 4e93bf747dde25f385604a34245b11c859288fea
 SHA1 (patch-ad) = a171713f505944f2f10c203093cca884e68823ec
 SHA1 (patch-ae) = 1a863ac53ffa46e838f2f88029b6ab26847f96b2
 SHA1 (patch-af) = 79fdee0097ee8c83b6e698ac7325382bceb7ab04
diff -r e7ac8f51e5ee -r 72122a1d4a31 net/xmftp/patches/patch-ac
--- a/net/xmftp/patches/patch-ac        Sat Dec 01 13:23:14 2007 +0000
+++ b/net/xmftp/patches/patch-ac        Sat Dec 01 13:39:05 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ac,v 1.1.1.1 2002/04/21 10:47:32 rh Exp $
+$NetBSD: patch-ac,v 1.2 2007/12/01 13:39:05 rillig Exp $
 
---- ftplib/ftplib.c.orig       Tue Apr 16 20:13:05 2002
-+++ ftplib/ftplib.c
+--- ftplib/ftplib.c.orig       1997-08-20 21:29:58.000000000 +0200
++++ ftplib/ftplib.c    2007-12-01 14:37:55.000000000 +0100
 @@ -25,10 +25,10 @@
  #include "../ui/xmftp.h"
  #include "../ui/operations.h"
@@ -24,7 +24,7 @@
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
-@@ -93,7 +93,7 @@
+@@ -93,7 +93,7 @@ static char *version =
  
  GLOBALDEF int ftplib_debug = 0;
  
@@ -33,3 +33,23 @@
  #define net_read read
  #define net_write write
  #define net_close close
+@@ -410,12 +410,13 @@ static int FtpPort(netbuf *nControl)
+       return -1;
+     cp++;
+     sscanf(cp,"%d,%d,%d,%d,%d,%d",&v[2],&v[3],&v[4],&v[5],&v[0],&v[1]);
+-    (unsigned char)sin.sa.sa_data[2] = v[2];
+-    (unsigned char)sin.sa.sa_data[3] = v[3];
+-    (unsigned char)sin.sa.sa_data[4] = v[4];
+-    (unsigned char)sin.sa.sa_data[5] = v[5];
+-    (unsigned char)sin.sa.sa_data[0] = v[0];
+-    (unsigned char)sin.sa.sa_data[1] = v[1];
++    /* TODO: check that sscanf returns 6 */
++    sin.sa.sa_data[2] = (unsigned char)v[2];
++    sin.sa.sa_data[3] = (unsigned char)v[3];
++    sin.sa.sa_data[4] = (unsigned char)v[4];
++    sin.sa.sa_data[5] = (unsigned char)v[5];
++    sin.sa.sa_data[0] = (unsigned char)v[0];
++    sin.sa.sa_data[1] = (unsigned char)v[1];
+     sData = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
+     if (sData == -1)
+     {



Home | Main Index | Thread Index | Old Index