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...
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 8a0bd8b..bedc6e9 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -2160,6 +2160,9 @@
     mbedtls_x509_name *name;
     mbedtls_x509_sequence *cur = NULL;
 
+    if( profile == NULL )
+        return( MBEDTLS_ERR_X509_BAD_INPUT_DATA );
+
     *flags = 0;
 
     if( cn != NULL )