From a83e4e2bf5fbb8607b292b6a880c050e3429decf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 17 Jun 2015 11:53:48 +0200 Subject: [PATCH] Extra check in verify_with_profile() This could happen if someone doesn't set the SSL configuration properly. In that case we don't want to segfault... --- library/x509_crt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/x509_crt.c b/library/x509_crt.c index 8a0bd8b49..bedc6e98f 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2160,6 +2160,9 @@ int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt, mbedtls_x509_name *name; mbedtls_x509_sequence *cur = NULL; + if( profile == NULL ) + return( MBEDTLS_ERR_X509_BAD_INPUT_DATA ); + *flags = 0; if( cn != NULL )