From: Bruce Lee Date: Tue, 30 Jul 2019 21:43:14 +0000 (+0100) Subject: Auth: handle socket read errors in Dovecot authenticator X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/2ac2eff3c9914a9c77b03db64b31819f361576b9 Auth: handle socket read errors in Dovecot authenticator (cherry picked from commit c9f1be94cc304f0343c93b66efa41a747d307fb1) (cherry picked from commit 4ba26a040b8765dea7134c883d046418a8b053a1) --- diff --git a/src/src/auths/dovecot.c b/src/src/auths/dovecot.c index b1dde06af..b1c2c6f85 100644 --- a/src/src/auths/dovecot.c +++ b/src/src/auths/dovecot.c @@ -212,8 +212,8 @@ for (;;) { if (socket_buffer_left == 0) { - socket_buffer_left = read(fd, sbuffer, sizeof(sbuffer)); - if (socket_buffer_left == 0) { if (count == 0) return NULL; else break; } + if ((socket_buffer_left = read(fd, sbuffer, sizeof(sbuffer))) <= 0) + if (count == 0) return NULL; else break; p = 0; }