[balsa] Assert that a node is not NULL



commit a0928a2d83da348ce2fd9499566f025d7e4906f2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 28 16:33:03 2017 -0400

    Assert that a node is not NULL
    
        * libbalsa/mailbox.c (lbm_next): assert that node is not NULL
        before testing whether it is the root node

 ChangeLog          |    8 ++++++++
 libbalsa/mailbox.c |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0d5194c..41b684f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2017-06-28  Peter Bloomfield  <pbloomfield bellsouth net>
 
+       Assert that a node is not NULL
+
+       * libbalsa/mailbox.c (lbm_next): assert that node is not NULL
+       before testing whether it is the root node
+
+
+2017-06-28  Peter Bloomfield  <pbloomfield bellsouth net>
+
        Check for NULL pointer
 
        * libbalsa/mailbox.c (lbm_sort): check for NULL prev.
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index 91613e9..8351fa8 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -1735,6 +1735,7 @@ lbm_next(GNode * node)
         if (node->next)
             return node->next;
         node = node->parent;
+        g_assert(node != NULL);
     } while (!G_NODE_IS_ROOT(node));
 
     return node;


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