1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 03:49:01 +00:00

nse_check_globals cleanup

This commit is contained in:
patrik
2012-08-02 05:25:15 +00:00
parent 1d2f6906f5
commit 37e9cadc3c
3 changed files with 8 additions and 5 deletions

View File

@@ -32,6 +32,8 @@ local stdnse = require 'stdnse'
local httpspider = require 'httpspider'
local string = require 'string'
local bin = require 'bin'
local bit = require 'bit'
local table = require 'table'
-- These definitions are copied/pasted/reformatted from the jhead-2.96 sourcecode
-- (the code is effectively public domain, but credit where credit's due!)
@@ -351,7 +353,7 @@ local function process_gps(data, pos, endian, result)
-- Loop through the entries to find the fun stuff
for i=1, num_entries do
pos, tag, format, components, value = bin.unpack(endian .. "SSII", data, pos)
local pos, tag, format, components, value = bin.unpack(endian .. "SSII", data, pos)
if(tag == GPS_TAG_LATITUDE or tag == GPS_TAG_LONGITUDE) then
local dummy, gps, h, m, s
@@ -396,13 +398,13 @@ local function parse_exif(exif_data)
local sig, marker, size
local tag, format, components, byte_count, value, offset, dummy, data
local status, result
local header1, header2, tiff_header_1, first_offset
local tiff_header_1, first_offset
-- Initialize the result table
result = {}
-- Read the verify the EXIF header
pos, header1, header2, endian = bin.unpack(">ISS", exif_data, 1)
local pos, header1, header2, endian = bin.unpack(">ISS", exif_data, 1)
if(header1 ~= 0x45786966 or header2 ~= 0x0000) then
return false, "Invalid EXIF header"
end

View File

@@ -117,7 +117,7 @@ aka "Print Spooler Service Impersonation Vulnerability."
local data = lanman_result.data
local pos, status, convert, entry_count, available_entries = bin.unpack("<SSSS", parameters)
pos = 0
local share_type
local share_type, name, _
for i = 1, entry_count, 1 do
_,share_type = bin.unpack(">s",data,pos+14)
pos, name = bin.unpack("<z", data, pos)

View File

@@ -2,6 +2,7 @@ local shortport = require "shortport"
local stdnse = require "stdnse"
local table = require "table"
local bin = require "bin"
local nmap = require "nmap"
local os = require "os"
local string = require "string"
description = [[
@@ -105,7 +106,7 @@ end
-- extract time from ServerHello response
local extract_time = function(response)
local result
local shlength, npndata, protocol
local shlength, npndata, protocol, _
if not response then
stdnse.print_debug(SCRIPT_NAME .. ": Didn't get response.")