Fix use after free in enter_user_mode, use user.<name>
for modename
Fixes #3192
This commit is contained in:
parent
b464822f1b
commit
6eb820dc54
|
@ -2413,9 +2413,10 @@ const CommandDesc declare_user_mode_cmd = {
|
|||
}
|
||||
};
|
||||
|
||||
void enter_user_mode(Context& context, StringView mode_name, KeymapMode mode, bool lock)
|
||||
// We need ownership of the mode_name in the lock case
|
||||
void enter_user_mode(Context& context, String mode_name, KeymapMode mode, bool lock)
|
||||
{
|
||||
on_next_key_with_autoinfo(context, format("user:{}", mode_name), KeymapMode::None,
|
||||
on_next_key_with_autoinfo(context, format("user.{}", mode_name), KeymapMode::None,
|
||||
[mode_name, mode, lock](Key key, Context& context) mutable {
|
||||
if (key == Key::Escape)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user