Date: 10 Jul 2000 09:41:50 +0200 From: Dag-Erling Smorgrav <des@flood.ping.uio.no> To: Hajimu UMEMOTO <ume@bisd.hitachi.co.jp> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libfetch ftp.c Message-ID: <xzp1z123001.fsf@flood.ping.uio.no> In-Reply-To: Hajimu UMEMOTO's message of "Mon, 10 Jul 2000 16:13:19 %2B0900" References: <200007080927.CAA28425@freefall.freebsd.org> <20000710.004713.71082196.ume@mahoroba.org> <xzpsnti325b.fsf@flood.ping.uio.no> <200007100713.e6A7DKF39317@plum.ssr.bisd.hitachi.co.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
How's this?
Index: ftp.c
===================================================================
RCS file: /home/ncvs/src/lib/libfetch/ftp.c,v
retrieving revision 1.28
diff -u -u -r1.28 ftp.c
--- ftp.c 2000/07/08 09:27:47 1.28
+++ ftp.c 2000/07/10 07:39:51
@@ -300,15 +300,15 @@
* is IMHO the one and only weak point in the FTP protocol.
*/
ln = last_reply;
- for (p = ln + 3; *p && !isdigit(*p); p++)
- /* nothing */ ;
- if (!*p) {
- e = 999;
- goto ouch;
- }
- switch (e) {
+ switch (e) {
case FTP_PASSIVE_MODE:
case FTP_LPASSIVE_MODE:
+ for (p = ln + 3; *p && !isdigit(*p); p++)
+ /* nothing */ ;
+ if (!*p) {
+ e = 999;
+ goto ouch;
+ }
l = (e == FTP_PASSIVE_MODE ? 6 : 21);
for (i = 0; *p && i < l; i++, p++)
addr[i] = strtol(p, &p, 10);
@@ -318,6 +318,13 @@
}
break;
case FTP_EPASSIVE_MODE:
+ for (p = ln + 3; *p && p != '('; p++)
+ /* nothing */ ;
+ if (!*p) {
+ e = 999;
+ goto ouch;
+ }
+ ++p;
if (sscanf(p, "%c%c%c%d%c", &addr[0], &addr[1], &addr[2],
&port, &addr[3]) != 5 ||
addr[0] != addr[1] ||
DES
--
Dag-Erling Smorgrav - des@flood.ping.uio.no
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp1z123001.fsf>
