Skip to content

Commit

Permalink
Merge pull request #497 from fooishbar/download-validate-empty
Browse files Browse the repository at this point in the history
download: Actually validate empty pathnames
  • Loading branch information
obbardc authored May 15, 2024
2 parents e8bc216 + ecbea7a commit 6550de9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actions/download_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (d *DownloadAction) validateFilename(context *debos.DebosContext, url *url.
} else {
filename = path.Base(d.Filename)
}
if len(filename) == 0 {
if len(filename) == 0 || filename == "." || filename == "/" {
return "", fmt.Errorf("Incorrect filename is provided for '%s'", d.Url)
}
filename = path.Join(context.Scratchdir, filename)
Expand Down

0 comments on commit 6550de9

Please sign in to comment.