gmenumodel: disallow exporting large menus on the bus

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
This commit is contained in:
Lars Uebernickel
2022-12-14 11:29:10 +00:00
committed by Philip Withnall
parent a0dbaeed2f
commit 89a7bbcf6e
5 changed files with 198 additions and 4 deletions

View File

@@ -4328,6 +4328,7 @@ g_power_profile_level_get_type
<SECTION>
<FILE>gmenuexporter</FILE>
G_MENU_EXPORTER_MAX_SECTION_SIZE
g_dbus_connection_export_menu_model
g_dbus_connection_unexport_menu_model
</SECTION>