From 16d50c48dab06933502ea548ead582bf83e935aa Mon Sep 17 00:00:00 2001 From: patrik Date: Sun, 16 Dec 2012 16:51:47 +0000 Subject: [PATCH] Squashed commit of the following: commit fb1fa9373592e81ee004b99cf813e07bf253fbe1 Author: Patrik Karlsson Date: Sun Dec 16 11:49:36 2012 -0500 Fix bug where brute library failed to report error on invalid iterators --- nselib/brute.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nselib/brute.lua b/nselib/brute.lua index d2c52e819..527c99af6 100644 --- a/nselib/brute.lua +++ b/nselib/brute.lua @@ -651,6 +651,13 @@ Engine = local usernames = self.usernames local passwords = self.passwords + if ( "function" ~= type(usernames) ) then + return false, "Invalid usernames iterator" + end + if ( "function" ~= type(passwords) ) then + return false, "Invalid passwords iterator" + end + local mode = self.options.mode or stdnse.get_script_args("brute.mode") -- if no mode was given, but a credfile is present, assume creds mode