From 74a7329c0041037877e05ccb20316524aa0eb376 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Fri, 1 May 2020 16:05:37 -0400 Subject: [PATCH] Validate log list after loading it --- loglist/load.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/loglist/load.go b/loglist/load.go index 75b59dc..c3e7ef2 100644 --- a/loglist/load.go +++ b/loglist/load.go @@ -54,5 +54,8 @@ func unmarshal(jsonBytes []byte) (*List, error) { if err := json.Unmarshal(jsonBytes, list); err != nil { return nil, err } + if err := list.Validate(); err != nil { + return nil, fmt.Errorf("Invalid log list: %s", err) + } return list, nil }