From d5a888fa3130d2d05bf045c9ef90a3beaac54be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 21 Apr 2022 16:40:09 +0200 Subject: [PATCH] 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,