From f3910624b8314145a8cb026e55112a93d672fc3f Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 19 Apr 2018 08:33:11 +0200 Subject: add more error checks There are still some cases where the input is not correctly checked, but it is moving forward. --- pem.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pem.go') diff --git a/pem.go b/pem.go index bbe2a47..2fdf3cc 100644 --- a/pem.go +++ b/pem.go @@ -35,6 +35,9 @@ func parseFile(file io.Reader) (pemMap, error) { if err != nil { return nil, err } + if len(raw) == 0 { + return nil, fmt.Errorf("file is empty") + } return parsePem(raw) } -- cgit v1.2.3-70-g09d2