From 8c2d4ff84c4db1eb59d3a3fb007803f82c4906b9 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Thu, 7 Sep 2017 09:57:11 +0100 Subject: [PATCH] smtp.c: Use read-end of pipe, not random integer. Instead of `pdi[0]' the array of two elements was being indexed by `i'. That is typically zero so everything works, but can be up to five depending how many times fork(2) failed before succeeding. Fixes e65127948. --- mts/smtp/smtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 3d2a8e5b..1b92db9f 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -349,7 +349,7 @@ sendmail_init (char *client, int watch, int verbose, int debug, int sasl, close (pdi[1]); close (pdo[0]); - netsec_set_fd(nsc, pdi[i], pdo[1]); + netsec_set_fd(nsc, pdi[0], pdo[1]); netsec_set_timeout(nsc, SM_OPEN); result = smhear (); switch (result) { -- 2.56.0