mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Merge branch '2197-option-group-limits' into 'master'
goption: Add a precondition to avoid GOptionEntry list overflow Closes #2197 See merge request GNOME/glib!1638
This commit is contained in:
commit
b01bcd38a6
@ -2422,6 +2422,8 @@ g_option_group_add_entries (GOptionGroup *group,
|
||||
|
||||
for (n_entries = 0; entries[n_entries].long_name != NULL; n_entries++) ;
|
||||
|
||||
g_return_if_fail (n_entries <= G_MAXSIZE - group->n_entries);
|
||||
|
||||
group->entries = g_renew (GOptionEntry, group->entries, group->n_entries + n_entries);
|
||||
|
||||
/* group->entries could be NULL in the trivial case where we add no
|
||||
|
Loading…
Reference in New Issue
Block a user