Skip to content

@rentzsch /CVE-2013-0262 harness.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require 'pp'
SEPS = Regexp.union(*[::File::SEPARATOR, ::File::ALT_SEPARATOR].compact)
def inspectPath(path_info)
parts = path_info.split SEPS
parts.inject(0) do |depth, part|
case part
when '', '.'
depth
when '..'
throw 'climb-out detected' if depth - 1 < 0
depth - 1
else
depth + 1
end
end
parts
end
pp inspectPath('./..')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.