[balsa: 1/2] Check for GLIB stable version




commit b7c782775a724a5248f8239e09fe01e13c31dfaf
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Feb 5 13:31:41 2021 -0500

    Check for GLIB stable version
    
    g_memdup() will be deprecated in version 2.68, so check for that version
    before using g_memdup2().
    
    The only places where it is called are with a fixed small byte_size
    argument that cannot overflow when cast from size_t to unsigned, so
    the code is not vulnerable; we need only to avoid the deprecation
    warning.
    
    modified:   libbalsa/mailbox_mbox.c

 libbalsa/mailbox_mbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libbalsa/mailbox_mbox.c b/libbalsa/mailbox_mbox.c
index e723bf86e..0961c5a81 100644
--- a/libbalsa/mailbox_mbox.c
+++ b/libbalsa/mailbox_mbox.c
@@ -496,7 +496,7 @@ parse_mailbox(LibBalsaMailboxMbox * mbox)
             continue;
 
         msg_info.local_info.flags = msg_info.orig_flags;
-#if GLIB_CHECK_VERSION(2, 67, 3)
+#if GLIB_CHECK_VERSION(2, 68, 0)
         g_ptr_array_add(mbox->msgno_2_msg_info, g_memdup2(&msg_info, sizeof(msg_info)));
 #else
         g_ptr_array_add(mbox->msgno_2_msg_info, g_memdup(&msg_info, sizeof(msg_info)));
@@ -584,7 +584,7 @@ lbm_mbox_restore(LibBalsaMailboxMbox * mbox)
             && !lbm_mbox_seek_to_message(mbox, msg_info->end))
             /* Error: no message following this one. */
             break;
-#if GLIB_CHECK_VERSION(2, 67, 3)
+#if GLIB_CHECK_VERSION(2, 68, 0)
         g_ptr_array_add(mbox->msgno_2_msg_info, g_memdup2(msg_info, sizeof *msg_info));
 #else
         g_ptr_array_add(mbox->msgno_2_msg_info, g_memdup(msg_info, sizeof *msg_info));


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