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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user