[balsa/48-bad-capability: 3/5] imap-auth: Abandon authentication on NULL sio




commit 7508f991919102fe2a7a6a8b50b7c697ee665cb8
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Dec 12 10:37:43 2020 -0500

    imap-auth: Abandon authentication on NULL sio
    
    Abandon authentication if ImapHandle:NetClientSioBuf is NULL. It can
    happen only if the server sends a BYE response or we disconnected the
    handle, and in either case we cannot continue with authentication.

 libbalsa/imap/imap-auth.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/libbalsa/imap/imap-auth.c b/libbalsa/imap/imap-auth.c
index d94ca3dd4..d760fec16 100644
--- a/libbalsa/imap/imap-auth.c
+++ b/libbalsa/imap/imap-auth.c
@@ -61,6 +61,8 @@ imap_authenticate(ImapMboxHandle* handle)
 
   for(authenticator = imap_authenticators_arr;
       *authenticator; authenticator++) {
+      if (handle->sio == NULL)
+        return r;
     if ((r = (*authenticator)(handle)) 
         != IMAP_AUTH_UNAVAIL) {
       if (r == IMAP_SUCCESS)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]