[balsa/48-bad-capability: 4/5] imap-commands: Check return value




commit ae4b470768ac0f418f583d0c5e827ecce98dd55c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Dec 12 10:44:45 2020 -0500

    imap-commands: Check return value
    
    Check the return value of imap_check_capability(); it may have failed,
    in which case we need to bail out.

 libbalsa/imap/imap-commands.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libbalsa/imap/imap-commands.c b/libbalsa/imap/imap-commands.c
index 09319c760..ab9fedf2d 100644
--- a/libbalsa/imap/imap-commands.c
+++ b/libbalsa/imap/imap-commands.c
@@ -134,8 +134,10 @@ imap_mbox_handle_can_do(ImapMboxHandle* handle, ImapCapability cap)
     return handle->can_fetch_body;
 
   /* perhaps it already has capabilities? */
-  if(!handle->has_capabilities)
-    imap_check_capability(handle);
+  if(!handle->has_capabilities) {
+    if(!imap_check_capability(handle))
+      return 0;
+  }
 
   if(cap<IMCAP_MAX)
     return handle->capabilities[cap];


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