Change all g_memdup() to g_memdup2()

Using g_memdup() is dangerous due to the type of the size argument. See
https://gitlab.gnome.org/GNOME/glib/-/issues/2319 and
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926 for details.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1708>
This commit is contained in:
Jonas Ådahl
2021-02-04 18:45:59 +01:00
parent 70c5febdd9
commit 30e1c51b33
19 changed files with 75 additions and 50 deletions

View File

@ -263,7 +263,7 @@ cached_mode_set_new (GList *connectors,
cached_mode_set = g_new0 (CachedModeSet, 1);
*cached_mode_set = (CachedModeSet) {
.connectors = g_list_copy (connectors),
.drm_mode = g_memdup (drm_mode, sizeof *drm_mode),
.drm_mode = g_memdup2 (drm_mode, sizeof *drm_mode),
};
return cached_mode_set;