From 356c1e12a960249208b18031a0208517d610ebe3 Mon Sep 17 00:00:00 2001 From: patrik Date: Thu, 4 Nov 2010 18:53:56 +0000 Subject: [PATCH] fixed the following bug reported by Ron ./scripts/ldap-brute.nse:75: attempt to get length of local 'contexts' (a nil value) stack traceback: ./scripts/ldap-brute.nse:75: in function 'get_naming_context' ./scripts/ldap-brute.nse:121: in function <./scripts/ldap-brute.nse:95> (tail call): ? --- scripts/ldap-brute.nse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ldap-brute.nse b/scripts/ldap-brute.nse index ab840bad1..a4775ee59 100644 --- a/scripts/ldap-brute.nse +++ b/scripts/ldap-brute.nse @@ -72,7 +72,7 @@ function get_naming_context( socket ) contexts = ldap.extractAttribute( searchResEntries, "namingContexts" ) end - if #contexts > 0 then + if contexts and #contexts > 0 then return contexts[1] end