git://git.exim.org
/
users
/
heiko
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1cf4798
)
TLS: harden error-detection in TLS proxy process
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 3 Apr 2021 19:56:50 +0000
(20:56 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 3 Apr 2021 20:27:25 +0000
(21:27 +0100)
src/src/transports/smtp.c
patch
|
blob
|
history
diff --git
a/src/src/transports/smtp.c
b/src/src/transports/smtp.c
index ca589b0be0cc279c33f54c3861e01b4fa6257d92..c6099f960b2c1b008e58ac677fe7a2998c9c8e42 100644
(file)
--- 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;
}
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");
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)));
}
}
while (rc < 0 || !(FD_ISSET(tls_out.active.sock, &rfds) || FD_ISSET(pfd[0], &rfds)));