client: test duplicate entries in result tarballs

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2018-02-09 11:47:07 -08:00
parent 787af956e3
commit d295a16169
1 changed files with 4 additions and 0 deletions

View File

@ -583,6 +583,10 @@ func readTarToMap(dt []byte, compressed bool) (map[string]*tarItem, error) {
}
return nil, err
}
if _, ok := m[h.Name]; ok {
return nil, errors.Errorf("duplicate entries for %s", h.Name)
}
var dt []byte
if h.Typeflag == tar.TypeReg {
dt, err = ioutil.ReadAll(tr)