Log port and TLS details for a failed delivery
[exim.git] / src / src / smtp_in.c
index 9981e8d51feb8725645f7fc093062a7c50b82991..fbfe1ed7b94497ebbf12563779c7ee168558780a 100644 (file)
@@ -1183,8 +1183,14 @@ s_tlslog(uschar * s, int * sizep, int * ptrp)
     s = string_append(s, &size, &ptr, 3, US" SNI=\"",
       string_printing(tls_in.sni), US"\"");
 
-  if (sizep) *sizep = size;
-  if (ptrp) *ptrp = ptr;
+  if (s)
+    {
+    s[ptr] = '\0';
+    if (sizep) *sizep = size;
+    if (ptrp) *ptrp = ptr;
+    }
+  else
+    s = US"";
   return s;
 }
 #endif