]> diplodocus.org Git - nmh/commitdiff
smtp.c: Use read-end of pipe, not random integer.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 7 Sep 2017 08:57:11 +0000 (09:57 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 7 Sep 2017 08:57:11 +0000 (09:57 +0100)
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

index 3d2a8e5b6784f575b9d724e747614e63cedc2f59..1b92db9f056376a054e5aa11dea7bf09c7eb57a8 100644 (file)
@@ -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) {