pem: Make sure we actually parsed some data

This could happen if there is no separating empty line between header
and body.

References #3627.
This commit is contained in:
Tobias Brunner
2020-11-13 16:40:01 +01:00
parent 38a7816034
commit abb3f67bd1
+1 -1
View File
@@ -330,7 +330,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
/* set length to size of binary blob */
blob->len = dst.len;
if (state != PEM_POST)
if (state != PEM_POST || !blob->len)
{
DBG1(DBG_LIB, " file coded in unknown format, discarded");
return PARSE_ERROR;