mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
pem: Don't read beyond line ends
This commit is contained in:
parent
388351609d
commit
30c03a7df9
@ -61,7 +61,7 @@ static bool find_boundary(char* tag, chunk_t *line)
|
||||
|
||||
if (!present("-----", line) ||
|
||||
!present(tag, line) ||
|
||||
*line->ptr != ' ')
|
||||
!line->len || *line->ptr != ' ')
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@ -306,7 +306,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
|
||||
}
|
||||
|
||||
/* check for PGP armor checksum */
|
||||
if (*data.ptr == '=')
|
||||
if (data.len && *data.ptr == '=')
|
||||
{
|
||||
*pgp = TRUE;
|
||||
data.ptr++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user