From ac9c16628adb5dd4c2c66d81864420cf7c0ab216 Mon Sep 17 00:00:00 2001 From: Sam O'Connor Date: Mon, 9 May 2016 12:26:15 +1000 Subject: [PATCH] check for absolute paths --- src/info_zip.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/info_zip.jl b/src/info_zip.jl index 72c7bfb..7dc8d1f 100644 --- a/src/info_zip.jl +++ b/src/info_zip.jl @@ -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 @@ -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)