Skip to content

Commit

Permalink
check for absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed May 9, 2016
1 parent 4c70fbc commit ac9c166
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/info_zip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ end

function Base.get(z::Archive, filename::AbstractString, default=nothing)

@assert !ismatch(r"^/", filename)

if !haskey(z, filename)
return default
end
Expand All @@ -99,6 +101,8 @@ end

function Base.setindex!(z::Archive, data, filename::AbstractString)

@assert !ismatch(r"^/", filename)

# Write file to tempdir...
mkpath(joinpath(z.tempdir, dirname(filename)))
write(joinpath(z.tempdir, filename), data)
Expand Down

0 comments on commit ac9c166

Please sign in to comment.