This solves problems with validating untrusted inputs from D-Bus, where invalid numbers of added and removed menu entries, and positions, could be specified.
Original patch from
https://bugzilla.gnome.org/show_bug.cgi?id=728733#c7, tweaked by Philip
Withnall to add a few code comments and make
G_MENU_EXPORTER_MAX_SECTION_SIZE
public so callers can check their
inputs against it if they want. Also tweaked to use g_warning()
instead
of the nonexistent g_dbus_warning()
.
Fixes: #861 (closed)
Closes #861 (closed)