From cf277886240aa3017d23a953a5d17261eef9a153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaspar=20L=C3=B6chte?= Date: Fri, 15 Oct 2021 17:22:49 +0200 Subject: [PATCH] Use deprecation as warning for \n\nglib is<2.68 in debian buster and bullseye, so we need to relay on g_memdup for backwarts compatibility. (cherry picked from commit 076db36f08dd03645090b8a00344f47e910725e0) --- base/networking.c | 6 ++++++ util/kb.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/base/networking.c b/base/networking.c index 41017db77..439e1e8b8 100644 --- a/base/networking.c +++ b/base/networking.c @@ -365,13 +365,19 @@ gvm_resolve_list (const char *name) { struct sockaddr_in *addrin = (struct sockaddr_in *) p->ai_addr; ipv4_as_ipv6 (&(addrin->sin_addr), &dst); +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wdeprecated-declarations" list = g_slist_prepend (list, g_memdup (&dst, sizeof (dst))); +#pragma GCC diagnostic pop } else if (p->ai_family == AF_INET6) { struct sockaddr_in6 *addrin = (struct sockaddr_in6 *) p->ai_addr; memcpy (&dst, &(addrin->sin6_addr), sizeof (struct in6_addr)); +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wdeprecated-declarations" list = g_slist_prepend (list, g_memdup (&dst, sizeof (dst))); +#pragma GCC diagnostic pop } p = p->ai_next; } diff --git a/util/kb.c b/util/kb.c index c41b53a3e..c94826c34 100644 --- a/util/kb.c +++ b/util/kb.c @@ -629,7 +629,10 @@ redis2kbitem_single (const char *name, const redisReply *elt, int force_int) else { item->type = KB_TYPE_STR; +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wdeprecated-declarations" item->v_str = g_memdup (elt->str, elt->len + 1); +#pragma GCC diagnostic pop item->len = elt->len; }