aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-03-29 11:19:30 +0200
committerTobias Brunner <tobias@strongswan.org>2017-05-23 18:29:11 +0200
commit30c03a7df9a638b3c94d0405dd40a9fa1a57832c (patch)
tree0e6bad1ce7ea6b090cc91487ca8c4235d1463aaa
parent388351609dad7a96b6ac8857864e59642810bc56 (diff)
downloadstrongswan-30c03a7df9a638b3c94d0405dd40a9fa1a57832c.tar.bz2
strongswan-30c03a7df9a638b3c94d0405dd40a9fa1a57832c.tar.xz
pem: Don't read beyond line ends
-rw-r--r--src/libstrongswan/plugins/pem/pem_builder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/pem/pem_builder.c b/src/libstrongswan/plugins/pem/pem_builder.c
index 719a2a69e..cda703741 100644
--- a/src/libstrongswan/plugins/pem/pem_builder.c
+++ b/src/libstrongswan/plugins/pem/pem_builder.c
@@ -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++;