mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 03:32:12 +01:00
GBytes: deal with a corner-case
When calling g_bytes_unref_to_data on a GBytes with NULL data we could end up with double-free or use-after-free issues. https://bugzilla.gnome.org/show_bug.cgi?id=686091
This commit is contained in:
parent
3766b7b5cd
commit
969dd0adf3
@ -390,7 +390,7 @@ try_steal_and_unref (GBytes *bytes,
|
|||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
|
|
||||||
if (bytes->free_func != free_func)
|
if (bytes->free_func != free_func || bytes->data == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Are we the only reference? */
|
/* Are we the only reference? */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user