Merge pull request #309 from cheeseandcereal/fix_arbitrary_reading

fix missing metadata security vuln
This commit is contained in:
Andrea Spacca 2020-05-09 11:59:37 +02:00 committed by GitHub
commit 42adceb4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -614,9 +614,7 @@ func (s *Server) CheckMetadata(token, filename string, increaseDownload bool) (M
var metadata Metadata var metadata Metadata
r, _, err := s.storage.Get(token, fmt.Sprintf("%s.metadata", filename)) r, _, err := s.storage.Get(token, fmt.Sprintf("%s.metadata", filename))
if s.storage.IsNotExist(err) { if err != nil {
return metadata, nil
} else if err != nil {
return metadata, err return metadata, err
} }