[balsa] imap-handle: Guard against NULL pointer



commit 654e77ce00f27a3b1c2866012ea2805932d6637e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Feb 18 18:53:28 2019 -0500

    imap-handle: Guard against NULL pointer
    
            * libbalsa/imap/imap-handle.c (imap_body_from_stringi): guard
            against NULL pointer.

 ChangeLog                   | 5 +++++
 libbalsa/imap/imap-handle.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index e4a1bd498..312af4d19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/imap/imap-handle.c (imap_body_from_stringi): guard
+       against NULL pointer.
+
 2019-02-18  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * src/balsa-print-object-text.c (collect_attrs): initialize a
diff --git a/libbalsa/imap/imap-handle.c b/libbalsa/imap/imap-handle.c
index 317d803cc..2fd5ded0b 100644
--- a/libbalsa/imap/imap-handle.c
+++ b/libbalsa/imap/imap-handle.c
@@ -1629,7 +1629,7 @@ imap_body_from_stringi(const gchar *s, gchar const** end)
   if(*s == '(') {
     s++;
     body->envelope = imap_envelope_from_stringi(s+1, &s);
-    if( *s != ')')
+    if(s == NULL || *s != ')')
       goto done;
     s++;
   } else s++; /* assuming it points to 'X' */


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