commit | 9bf29bee22d85d370388683e708412bf0eecfc43 | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg2@elzevir.fr> | Mon Sep 28 18:27:15 2015 +0200 |
committer | Manuel Pégourié-Gonnard <mpg2@elzevir.fr> | Wed Sep 30 17:01:35 2015 +0200 |
tree | d39e2c81534f342e84a2985eef72957333a696ce | |
parent | 59efb6a1b9019dde5076d318d1b5130d06b52bf2 [diff] [blame] |
Fix potential random malloc in pem_read()
diff --git a/library/pem.c b/library/pem.c index 5060484..054fcff 100644 --- a/library/pem.c +++ b/library/pem.c
@@ -317,6 +317,9 @@ ( POLARSSL_AES_C || POLARSSL_DES_C ) */ } + if( s1 == s2 ) + return( POLARSSL_ERR_PEM_INVALID_DATA ); + len = 0; ret = base64_decode( NULL, &len, s1, s2 - s1 );