Merge pull request #814 from tonistiigi/digest-validate

llbsolver: validate digest on load
docker-19.03
Tõnis Tiigi 2019-02-05 10:01:27 -08:00 committed by GitHub
commit f1054dd8b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -186,7 +186,11 @@ func loadLLB(def *pb.Definition, fn func(digest.Digest, *pb.Op, func(digest.Dige
if v, ok := cache[dgst]; ok {
return v, nil
}
v, err := fn(dgst, allOps[dgst], rec)
op, ok := allOps[dgst]
if !ok {
return nil, errors.Errorf("invalid missing input digest %s", dgst)
}
v, err := fn(dgst, op, rec)
if err != nil {
return nil, err
}