glib/docs/reference
Philip Withnall f8cf0b8672 gstrfuncs: Add g_memdup2() function
This will replace the existing `g_memdup()` function, which has an
unavoidable security flaw of taking its `byte_size` argument as a
`guint` rather than as a `gsize`. Most callers will expect it to be a
`gsize`, and may pass in large values which could silently be truncated,
resulting in an undersize allocation compared to what the caller
expects.

This could lead to a classic buffer overflow vulnerability for many
callers of `g_memdup()`.

`g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`.

Spotted by Kevin Backhouse of GHSL.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: GHSL-2021-045
Helps: #2319
2021-02-04 14:13:03 +00:00
..
gio Add g_dbus_utils_object_path_escape and g_dbus_utils_object_path_unescape 2021-01-20 13:23:24 +00:00
glib gstrfuncs: Add g_memdup2() function 2021-02-04 14:13:03 +00:00
gobject docs: Mention GInitiallyUnowned when introducing refcounts 2020-12-12 18:47:00 +00:00
.gitignore .gitignore manpages (*.1) 2010-05-24 23:21:01 -04:00
AUTHORS Initial revision 1999-08-16 17:58:30 +00:00
COPYING Initial revision 1999-08-16 17:58:30 +00:00
meson.build gversionmacros: Add version macros for GLib 2.68 2020-10-01 14:33:21 +01:00
NEWS Initial revision 1999-08-16 17:58:30 +00:00