diff --git a/scripts/ftp-anon.nse b/scripts/ftp-anon.nse index 01d3f02c4..78d88c87d 100644 --- a/scripts/ftp-anon.nse +++ b/scripts/ftp-anon.nse @@ -78,12 +78,12 @@ local function list(socket, target, max_lines) local listing = {} while not max_lines or #listing < max_lines do local status, data = list_socket:receive_buf("\r?\n", false) + if (not status and data == "EOF") or data == "" then + break + end if not status then return status, data end - if data == "" then - break - end listing[#listing + 1] = data end