From owner-freebsd-arch Fri May 19 2:43:19 2000 Delivered-To: freebsd-arch@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 04BE537C052 for ; Fri, 19 May 2000 02:43:10 -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 LAA62937; Fri, 19 May 2000 11:43:03 +0200 (CEST) (envelope-from des@flood.ping.uio.no) To: Hajimu UMEMOTO (=?iso-2022-jp?b?GyRCR19LXBsoQiAbJEJIJRsoQg==?=) Cc: arch@FreeBSD.ORG Subject: Re: fetch(1) References: <200005122016.e4CKGtF38185@peace.mahoroba.org> <200005161852.e4GIqhF74521@peace.mahoroba.org> <200005162001.e4GK1bF75342@peace.mahoroba.org> From: Dag-Erling Smorgrav Date: 19 May 2000 11:43:03 +0200 In-Reply-To: Dag-Erling Smorgrav's message of "19 May 2000 11:28:57 +0200" Message-ID: Lines: 34 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-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dag-Erling Smorgrav writes: > There are some places in ftp.c (e.g. the passive ftp code) that assume > there is text after the status code; I'll see what I can do to fix them. I think this fixes the PASV case: Index: ftp.c =================================================================== RCS file: /home/ncvs/src/lib/libfetch/ftp.c,v retrieving revision 1.19 diff -u -r1.19 ftp.c --- ftp.c 2000/05/15 08:24:58 1.19 +++ ftp.c 2000/05/19 09:41:42 @@ -238,11 +239,13 @@ * is IMHO the one and only weak point in the FTP protocol. */ ln = last_reply; - for (p = ln + 3; !isdigit(*p); p++) + for (p = ln + 3; *p && !isdigit(*p); p++) /* nothing */ ; - for (p--, i = 0; i < 6; i++) { - p++; /* skip the comma */ + for (i = 0; *p, i < 6; i++, p++) addr[i] = strtol(p, &p, 10); + if (i < 6) { + e = 999; + goto ouch; } /* seek to required offset */ DES -- Dag-Erling Smorgrav - des@flood.ping.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message