Fix potential random malloc in pem_read()
diff --git a/library/pem.c b/library/pem.c
index 5c973ac..81098ee 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -287,6 +287,9 @@
 #endif /* POLARSSL_MD5_C && (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 );