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:
@ -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;
|
||||
|
Reference in New Issue
Block a user