llbsolver: validate digest on load

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-19.03
Tonis Tiigi 2019-02-04 17:06:23 -08:00
parent eefe2e2f21
commit 07810f0aae
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
}