From c800c437a9235798a3dad6bbbc12fefcd9410503 Mon Sep 17 00:00:00 2001 From: patrik Date: Wed, 13 Jul 2011 20:46:15 +0000 Subject: [PATCH] added check for unknown account state to avoid crash when retrieving accounts. --- nselib/creds.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nselib/creds.lua b/nselib/creds.lua index a1f2a2580..399690df1 100644 --- a/nselib/creds.lua +++ b/nselib/creds.lua @@ -267,11 +267,11 @@ Credentials = { for v in self.storage:getAll() do local h = ( v.host.ip or v.host ) local svc = ("%s/%s"):format(v.port,v.service) - local c + local c if ( v.user and #v.user > 0 ) then - c = ("%s:%s - %s"):format(v.user, v.pass, StateMsg[v.state]) + c = ("%s:%s - %s"):format(v.user, v.pass, StateMsg[v.state] or "Unknown state") else - c = ("%s - %s"):format(v.pass, StateMsg[v.state]) + c = ("%s - %s"):format(v.pass, StateMsg[v.state] or "Unknown state") end local script = v.scriptname assert(type(h)=="string", "Could not determine a valid host")