commit | a45aa1399bcbcffadd600369c1f8d9016d7886ba | [log] [tgz] |
---|---|---|
author | Simon Butcher <simon.butcher@arm.com> | Mon Oct 05 00:26:36 2015 +0100 |
committer | Simon Butcher <simon.butcher@arm.com> | Mon Oct 05 00:26:36 2015 +0100 |
tree | a0e1ec75e9dc97f53cb85e9eb91159a080486235 | |
parent | e7f96f22ee2f83d33707b174dd35e3661d2fdb14 [diff] [blame] |
Merge of IOTSSL-476 - Random malloc in pem_read()
diff --git a/library/pem.c b/library/pem.c index 541e870..1ee3966 100644 --- a/library/pem.c +++ b/library/pem.c
@@ -316,6 +316,9 @@ ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */ } + if( s1 == s2 ) + return( MBEDTLS_ERR_PEM_INVALID_DATA ); + ret = mbedtls_base64_decode( NULL, 0, &len, s1, s2 - s1 ); if( ret == MBEDTLS_ERR_BASE64_INVALID_CHARACTER )