diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2018-04-19 08:33:11 +0200 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2018-04-19 08:33:11 +0200 |
commit | f3910624b8314145a8cb026e55112a93d672fc3f (patch) | |
tree | 1de00b10be7d2be04c5c93363ae227f24851f179 /pem.go | |
parent | 083e8c2ce4ee8ed250d1e38bd115717733f0a324 (diff) |
add more error checks
There are still some cases where the input is not correctly checked, but
it is moving forward.
Diffstat (limited to 'pem.go')
-rw-r--r-- | pem.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) } |