[exim-cvs] TLS: harden error-detection in TLS proxy process

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] TLS: harden error-detection in TLS proxy process
Gitweb: https://git.exim.org/exim.git/commitdiff/5a8f5d724bbfd81cb2b89540e395359aaedc6c17
Commit:     5a8f5d724bbfd81cb2b89540e395359aaedc6c17
Parent:     1cf47989a0376c3f7156c214c1d509d372e4262b
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Apr 3 20:56:50 2021 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sat Apr 3 21:27:25 2021 +0100


    TLS: harden error-detection in TLS proxy process
---
 src/src/transports/smtp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index ca589b0..c6099f9 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -3368,11 +3368,15 @@ for (int fd_bits = 3; fd_bits; )
       goto done;
       }


+    /* For errors where not readable, bomb out */
+
     if (FD_ISSET(tls_out.active.sock, &efds) || FD_ISSET(pfd[0], &efds))
       {
       DEBUG(D_transport) debug_printf("select: exceptional cond on %s fd\n",
     FD_ISSET(pfd[0], &efds) ? "proxy" : "tls");
-      goto done;
+      if (!(FD_ISSET(tls_out.active.sock, &rfds) || FD_ISSET(pfd[0], &rfds)))
+    goto done;
+      DEBUG(D_transport) debug_printf("- but also readable; no exit yet\n");
       }
     }
   while (rc < 0 || !(FD_ISSET(tls_out.active.sock, &rfds) || FD_ISSET(pfd[0], &rfds)));