From 22b458476fb229ea7bd28479cca637db139fad5b Mon Sep 17 00:00:00 2001 From: jah Date: Wed, 25 Aug 2010 21:32:40 +0000 Subject: [PATCH] fix a test of a return from reg_get_value which caused the following error when getting NT_STATUS_WERR_ACCESS_DENIED from winreg.openhkpd smb-system-info.nse:131: attempt to perform arithmetic on field 'number_of_processors' (a string value) stack traceback: smb-system-info.nse:131: in function 'get_info_registry' smb-system-info.nse:182: in function (tail call): ? --- scripts/smb-system-info.nse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/smb-system-info.nse b/scripts/smb-system-info.nse index e41100fe4..efab9c6dd 100644 --- a/scripts/smb-system-info.nse +++ b/scripts/smb-system-info.nse @@ -117,7 +117,7 @@ local function get_info_registry(host) -- Processor information result['status-number_of_processors'], result['number_of_processors'] = reg_get_value(smbstate, openhklm_result['handle'], "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", "NUMBER_OF_PROCESSORS") - if(status == false) then + if(result['status-number_of_processors'] == false) then result['number_of_processors'] = 0 end result['status-os'], result['os'] = reg_get_value(smbstate, openhklm_result['handle'], "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", "OS")