1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 18:55:07 +00:00

LibGUI: Fix GMenu submenu shortcut bug.

I was encountering an entire system crash when the window server
attempted to do something with the shortcut text on a submenu. This
bug only seemed to appear when I had a lone submenu inside of a menu.
This commit is contained in:
Brandon Scott 2019-10-12 18:02:39 -05:00 committed by Andreas Kling
parent ef40ebbe6d
commit efc2fc6888

View file

@ -113,6 +113,11 @@ int GMenu::realize_menu()
request.menu.enabled = true;
request.menu.checkable = false;
request.menu.checked = false;
// no shortcut on submenu, make sure this is cleared out
request.menu.shortcut_text_length = 0;
strcpy(request.menu.shortcut_text, "\0");
ASSERT(submenu.name().length() < (ssize_t)sizeof(request.text));
strcpy(request.text, submenu.name().characters());
request.text_length = submenu.name().length();