From owner-cvs-all Mon Jul 10 0:42: 5 2000 Delivered-To: cvs-all@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 2AA4E37C4D9; Mon, 10 Jul 2000 00:41:57 -0700 (PDT) (envelope-from des@flood.ping.uio.no) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id JAA73325; Mon, 10 Jul 2000 09:41:51 +0200 (CEST) (envelope-from des@flood.ping.uio.no) To: Hajimu UMEMOTO Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libfetch ftp.c References: <200007080927.CAA28425@freefall.freebsd.org> <20000710.004713.71082196.ume@mahoroba.org> <200007100713.e6A7DKF39317@plum.ssr.bisd.hitachi.co.jp> From: Dag-Erling Smorgrav Date: 10 Jul 2000 09:41:50 +0200 In-Reply-To: Hajimu UMEMOTO's message of "Mon, 10 Jul 2000 16:13:19 +0900" Message-ID: Lines: 50 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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