BUGFIX: forced-fail smtp option tls_sni would dereference NULL
[exim.git] / src / src / tls-openssl.c
index a8a62fe8cbbc2ad7e263abe9342f7a9c585af0ee..64aa689fb74ab727a0cee93b0c1538d720afb645 100644 (file)
@@ -1338,7 +1338,11 @@ if (sni)
   {
   if (!expand_check(sni, US"tls_sni", &tls_out.sni))
     return FAIL;
-  if (!Ustrlen(tls_out.sni))
+  if (tls_out.sni == NULL)
+    {
+    DEBUG(D_tls) debug_printf("Setting TLS SNI forced to fail, not sending\n");
+    }
+  else if (!Ustrlen(tls_out.sni))
     tls_out.sni = NULL;
   else
     {