=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -r1.103 -r1.104 --- src/usr.bin/ftp/fetch.c 2010/08/25 20:32:37 1.103 +++ src/usr.bin/ftp/fetch.c 2012/04/23 21:22:02 1.104 @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.103 2010/08/25 20:32:37 martynas Exp $ */ +/* $OpenBSD: fetch.c,v 1.104 2012/04/23 21:22:02 sthen Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -746,7 +746,10 @@ 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;