Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use deprecation as warning for g_memdup (backport #605) #607

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions base/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions util/kb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down