Fix symlink-following. Bug 2909
[exim.git] / src / src / tls.c
index 76e72b5f58a10f3da1bc0b5afd70d21428b8d545..32b29ee3e4ded6062bb64dae30400ca092700393 100644 (file)
@@ -156,7 +156,7 @@ for (unsigned loop = 20;
   if (--loop == 0) { errno = ELOOP; return FALSE; }
   filename = buf[0] == '/'
     ? string_copyn(buf, (unsigned)len) /* mem released by tls_set_watch */
-    : string_sprintf("%.*s/%.*s", (int)(s - filename), (int)len);
+    : string_sprintf("%.*s/%.*s", (int)(s - filename), filename, (int)len, buf);
   s = Ustrrchr(filename, '/');
   }
 if (errno != EINVAL)