mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 03:11:48 +00:00
Reorder the checks a bit.
This commit is contained in:
parent
800acc5ac1
commit
8fa61605ba
1 changed files with 3 additions and 2 deletions
|
|
@ -182,13 +182,14 @@ function is_path_valid(resource)
|
|||
--remove the beginning slash
|
||||
resource = string.sub(resource, 2, string.len(resource))
|
||||
|
||||
--if it starts with a dot or a slash or a backslash, forbid any acccess to it.
|
||||
first_char = resource:sub(0, 1)
|
||||
--(Windows drive names are not welcome too.)
|
||||
if resource:match("^([a-zA-Z]):") then
|
||||
return false
|
||||
end
|
||||
|
||||
--if it starts with a dot or a slash or a backslash, forbid any acccess to it.
|
||||
first_char = resource:sub(0, 1)
|
||||
|
||||
if first_char == "." then
|
||||
return false
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue