Nmap Development mailing list archives

Re: [NSE] Multiple script errors


From: Patrik Karlsson <patrik () cqure net>
Date: Sun, 29 Jan 2012 16:33:13 +0100

On Sun, Jan 29, 2012 at 12:30 PM, Michael Kohl <citizen428 () gmail com> 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)


Thanks Michael. I've just applied the patch as r27950.

Cheers,
Patrik
-- 
Patrik Karlsson
http://www.cqure.net
http://twitter.com/nevdull77
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: