gio: Use g_memdup2() instead of g_memdup() in obvious places

Convert all the call sites which use `g_memdup()`’s length argument
trivially (for example, by passing a `sizeof()`), so that they use
`g_memdup2()` instead.

In almost all of these cases the use of `g_memdup()` would not have
caused problems, but it will soon be deprecated, so best port away from
it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2319
This commit is contained in:
Philip Withnall
2021-02-04 13:37:56 +00:00
parent f8cf0b8672
commit 73b293fd30
8 changed files with 19 additions and 19 deletions

View File

@@ -4016,7 +4016,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
/* Don't waste memory by copying padding - remember to update this
* when changing struct _GDBusInterfaceVTable in gdbusconnection.h
*/
return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
}
static void
@@ -4033,7 +4033,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
/* Don't waste memory by copying padding - remember to update this
* when changing struct _GDBusSubtreeVTable in gdbusconnection.h
*/
return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
}
static void