From 07810f0aaeefac312ff76668cd716eeaabdbc24d Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 4 Feb 2019 17:06:23 -0800 Subject: [PATCH] llbsolver: validate digest on load Signed-off-by: Tonis Tiigi --- solver/llbsolver/vertex.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/solver/llbsolver/vertex.go b/solver/llbsolver/vertex.go index f4cd9252..4ac7bd47 100644 --- a/solver/llbsolver/vertex.go +++ b/solver/llbsolver/vertex.go @@ -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 }