asyncftpclient.nim - don't assume a sufficiend line length (#14973)

(cherry picked from commit f4f21c89e5)
This commit is contained in:
Miran
2020-07-14 08:18:02 +02:00
committed by narimiran
parent 94a855893e
commit 66c21b9e95

View File

@@ -133,7 +133,7 @@ const multiLineLimit = 10000
proc expectReply(ftp: AsyncFtpClient): Future[TaintedString] {.async.} =
result = await ftp.csock.recvLine()
var count = 0
while result[3] == '-':
while line.len > 3 and line[3] == '-':
## Multi-line reply.
let line = await ftp.csock.recvLine()
result.add("\n" & line)