Skip to content
Snippets Groups Projects
Commit 586e8014 authored by John Hodge's avatar John Hodge
Browse files

Client - Fix to possible infinite loop in ReadLine

- If the remote host closes, recv() returns 0, this was not checked
 > Caused 100% CPU on motsugo when un in a backup script
parent 5cf5f1c0
No related merge requests found
......@@ -2219,7 +2219,7 @@ char *ReadLine(int Socket)
}
else {
len = recv(Socket, buf+bufPos, BUFSIZ-1-bufPos, 0);
if( len < 0 ) {
if( len <= 0 ) {
free(ret);
return strdup("599 Client Connection Error\n");
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment