Skip to content

util: Add backported version of g_memdup2()

Philip Chimento requested to merge ptomato/gjs:375-replace-gmemdup into master

As per https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html replace all use of g_memdup() inside GJS so that we don't use this bug-prone API that takes a 32-bit int for the size.

Since we have a policy of depending on at most the previous stable version of GLib, we copy the g_memdup2() from the GLib backport as _gjs_memdup2(), and it can be replaced with g_memdup2() later when we have to depend on GLib 2.68 for something else.

Closes #375 (closed)

Merge request reports