As noted on misc, ftp http://www.spamhaus.org/drop/drop.lasso fails due
to whitespace after the value of the content-length header.

wget/curl/lynx/w3m all handle this.

OK?

Index: fetch.c
===================================================================
RCS file: /cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.103
diff -u -p -r1.103 fetch.c
--- fetch.c     25 Aug 2010 20:32:37 -0000      1.103
+++ fetch.c     23 Apr 2012 07:19:45 -0000
@@ -746,7 +746,10 @@ again:
                cp = buf;
 #define CONTENTLEN "Content-Length: "
                if (strncasecmp(cp, CONTENTLEN, sizeof(CONTENTLEN) - 1) == 0) {
+                       size_t s;
                        cp += sizeof(CONTENTLEN) - 1;
+                       if (s=strcspn(cp, " \t"))
+                               *(cp+s) = 0;
                        filesize = strtonum(cp, 0, LLONG_MAX, &errstr);
                        if (errstr != NULL)
                                goto improper;

Reply via email to