From: Ralph Corderoy Date: Thu, 7 Sep 2017 08:57:11 +0000 (+0100) Subject: smtp.c: Use read-end of pipe, not random integer. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8c2d4ff84c4db1eb59d3a3fb007803f82c4906b9?ds=sidebyside;hp=f6d438b5e08d12eacb62f93a8ce1a6c22d2ae16d 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. --- 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) {