summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Lee <straightblast426@gmail.com>2019-07-30 22:43:14 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-08-02 13:27:42 +0100
commitc9f1be94cc304f0343c93b66efa41a747d307fb1 (patch)
tree3ebbb4fa7b7425ffa62fc2e3415f22fec34a22b5
parent81a559c80ccd6a0354b5485720c0205a69289fb5 (diff)
Auth: handle socket read errors in Dovecot authenticator
-rw-r--r--src/src/auths/dovecot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/src/auths/dovecot.c b/src/src/auths/dovecot.c
index 9c0c9b313..4628863e0 100644
--- a/src/src/auths/dovecot.c
+++ b/src/src/auths/dovecot.c
@@ -215,8 +215,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;
}