[libnotify] notification: Use g_memdup2 when available



commit d5a888fa3130d2d05bf045c9ef90a3beaac54be8
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Apr 21 16:40:09 2022 +0200

    notification: Use g_memdup2 when available
    
    It's not really an issue here, as we use a properly typed len, but
    better not to use a deprecated and potentially dangerous API.

 libnotify/notification.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/libnotify/notification.c b/libnotify/notification.c
index 1c442db..55cc46f 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -1056,7 +1056,11 @@ notify_notification_set_hint_byte_array (NotifyNotification *notification,
 
         g_return_if_fail (value != NULL || len == 0);
 
+#ifdef GLIB_VERSION_2_68
+        value_dup = g_memdup2 (value, len);
+#else
         value_dup = g_memdup (value, len);
+#endif
         notify_notification_set_hint (notification, key,
                                       g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
                                                                value_dup,


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