dataset: Do not increment

Do not increment the `data` pointer when it points to an item that has
not been inspected.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2672
This commit is contained in:
Peter Bloomfield 2022-06-22 12:51:07 -04:00
parent ebfbef1acd
commit 8c4598aab3

View File

@ -528,11 +528,8 @@ g_data_remove_internal (GData **datalist,
old[found_keys] = *data;
found_keys++;
if (data < data_end)
{
data_end--;
if (data < --data_end)
*data = *data_end;
}
d->len--;
@ -546,9 +543,11 @@ g_data_remove_internal (GData **datalist,
break;
}
}
else
{
data++;
}
}
if (found_keys > 0)
{