mirror of
https://github.com/nmap/nmap.git
synced 2026-09-21 15:46:45 +00:00
Correctly handle parsing of invalid URL segments. Fixes #2651
This commit is contained in:
parent
6bd98c22ea
commit
6a567c7c0a
1 changed files with 3 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ local segment_set = make_set {
|
|||
"-", "_", ".", "!", "~", "*", "'", "(",
|
||||
")", ":", "@", "&", "=", "+", "$", ",",
|
||||
}
|
||||
setmetatable(segment_set, { __index = hex_esc })
|
||||
setmetatable(segment_set, { __index = function(t, c) return hex_esc(c) end })
|
||||
|
||||
---
|
||||
-- Protects a path segment, to prevent it from interfering with the
|
||||
|
|
@ -91,7 +91,8 @@ local function absolute_path(base_path, relative_path)
|
|||
end
|
||||
local path = relative_path
|
||||
if path:sub(1, 1) ~= "/" then
|
||||
path = fixdots(base_path):gsub("[^/]*$", path)
|
||||
-- function wrapper to avoid %-substitution of captures
|
||||
path = fixdots(base_path):gsub("[^/]*$", function() return path end)
|
||||
end
|
||||
-- Break the path into segments, processing dot and dot-dot
|
||||
local segs = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue