pem: Don't read beyond line ends
This commit is contained in:
@@ -61,7 +61,7 @@ static bool find_boundary(char* tag, chunk_t *line)
|
|||||||
|
|
||||||
if (!present("-----", line) ||
|
if (!present("-----", line) ||
|
||||||
!present(tag, line) ||
|
!present(tag, line) ||
|
||||||
*line->ptr != ' ')
|
!line->len || *line->ptr != ' ')
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check for PGP armor checksum */
|
/* check for PGP armor checksum */
|
||||||
if (*data.ptr == '=')
|
if (data.len && *data.ptr == '=')
|
||||||
{
|
{
|
||||||
*pgp = TRUE;
|
*pgp = TRUE;
|
||||||
data.ptr++;
|
data.ptr++;
|
||||||
|
|||||||
Reference in New Issue
Block a user