1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 21:09:00 +00:00

Fix NSE hangs when service sends non-matching data to receive_buf

This commit is contained in:
dmiller
2017-03-29 20:41:59 +00:00
parent 85e10c6b2b
commit 3dec043ead
26 changed files with 92 additions and 39 deletions

View File

@@ -5,6 +5,7 @@
local base64 = require "base64"
local comm = require "comm"
local match = require "match"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
@@ -163,7 +164,7 @@ function capabilities(host, port)
return nil, "Failed to send"
end
status, line = socket:receive_buf("%.", false)
status, line = socket:receive_buf(match.pattern_limit("%.", 2048), false)
if( not(status) ) then
return nil, "Failed to receive"
end