Nmap Development mailing list archives

Re: [NSE] Multiple script errors


From: Duarte Silva <duarte.silva () serializing me>
Date: Sun, 29 Jan 2012 13:45:16 +0000

I do agree it isn't very pretty, but it would suffice and since it isn't very 
hard to understand, I will give it a thumbs up :P

Regards,
Duarte Silva

On Sunday 29 January 2012 12:30:45 Michael Kohl wrote:
On Sat, Jan 28, 2012 at 11:04 PM, Patrik Karlsson <patrik () cqure net> wrote:
Thanks for reporting this Duarte. I fixed all of them but
http-generator.
Will look into it later, unless someone else does.

Would this be too dirty a fix?

diff --git a/scripts/http-generator.nse b/scripts/http-generator.nse
index 40e17ce..e835f1f 100644
--- a/scripts/http-generator.nse
+++ b/scripts/http-generator.nse
@@ -50,7 +50,7 @@ local follow_redirects = function(host, port, path, n)
    local pattern = "^[hH][tT][tT][pP]/1.[01] 30[12]"
    local response = http.get(host, port, path)

-   while response['status-line']:match(pattern) and n > 0 do
+   while (response['status-line'] or ""):match(pattern) and n > 0 do
       n = n - 1
       loc = response.header['location']
       response = http.get_url(loc)

Attachment: smime.p7s
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: