summaryrefslogtreecommitdiff
path: root/net/xmftp/patches
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-12-01 13:39:05 +0000
committerrillig <rillig@pkgsrc.org>2007-12-01 13:39:05 +0000
commitc1ac3212e5c48df0a4d19a60c0de0f512536538e (patch)
tree6954e56ab8df057b310bf026cef8406202fa64d1 /net/xmftp/patches
parente4ff5b9d6dabc53bee7e5e7f448be7867f919d9a (diff)
downloadpkgsrc-c1ac3212e5c48df0a4d19a60c0de0f512536538e.tar.gz
Fixed invalid lvalue cast and reminded the programmers that the return
value of sscanf needs to be checked.
Diffstat (limited to 'net/xmftp/patches')
-rw-r--r--net/xmftp/patches/patch-ac28
1 files changed, 24 insertions, 4 deletions
diff --git a/net/xmftp/patches/patch-ac b/net/xmftp/patches/patch-ac
index ab92bd27bb5..9384ae2fd4d 100644
--- a/net/xmftp/patches/patch-ac
+++ b/net/xmftp/patches/patch-ac
@@ -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 @@ $NetBSD: patch-ac,v 1.1.1.1 2002/04/21 10:47:32 rh Exp $
#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 @@ $NetBSD: patch-ac,v 1.1.1.1 2002/04/21 10:47:32 rh Exp $
#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)
+ {