diff options
author | 2016-01-28 21:31:50 +0000 | |
---|---|---|
committer | 2016-01-28 21:31:50 +0000 | |
commit | d651329d1550fa357ed63fa29c4b41030404f6ab (patch) | |
tree | d12ff0b55acba009fe585f972fa5c29344bc5a1b /usr.bin/ftp/fetch.c | |
parent | Hand rolled lists suck. First, replace disk_order with an LIST. (diff) | |
download | wireguard-openbsd-d651329d1550fa357ed63fa29c4b41030404f6ab.tar.xz wireguard-openbsd-d651329d1550fa357ed63fa29c4b41030404f6ab.zip |
Fix a crash when a server sends a non-standard newline ("\n" instead of "\r\n").
Present since ssl support was initially added in OpenBSD 4.0
Found by sthen@ via github downtime
OK sthen@
Diffstat (limited to '')
-rw-r--r-- | usr.bin/ftp/fetch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index eda0146a553..db80d773566 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.144 2016/01/08 20:36:01 sthen Exp $ */ +/* $OpenBSD: fetch.c,v 1.145 2016/01/28 21:31:50 martijn Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -1557,8 +1557,10 @@ again: errx(1, "SSL read error: %s", tls_error(tls)); buf[i] = c; - if (c == '\n') + if (c == '\n') { + buf[i] = '\0'; break; + } } *lenp = i; return (buf); |