mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Use 1-indexing for first char of Lua string.
sub(0, 1) worked, but it's more clear to do sub(1, 1).
This commit is contained in:
parent
492ca905e2
commit
27af1d09df
1 changed files with 2 additions and 2 deletions
|
|
@ -221,7 +221,7 @@ function is_path_valid(resource)
|
|||
end
|
||||
|
||||
--if it starts with a dot or a slash or a backslash, forbid any acccess to it.
|
||||
first_char = resource:sub(0, 1)
|
||||
first_char = resource:sub(1, 1)
|
||||
|
||||
if first_char == "." then
|
||||
return false
|
||||
|
|
@ -373,7 +373,7 @@ debug("Got a request for '" .. resource
|
|||
resource = url_decode(resource)
|
||||
|
||||
--make sure that the resource starts with a slash.
|
||||
if resource:sub(0, 1) ~= '/' then
|
||||
if resource:sub(1, 1) ~= '/' then
|
||||
do_400() --could probably use a fancier error here.
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue