termio: copy input command to avoid memory corruption

Fixes #2779
This commit is contained in:
Mitchell Hashimoto
2024-11-23 09:40:00 -08:00
parent 8deefca7f3
commit 70cc2d9793

View File

@ -78,7 +78,7 @@ pub fn setup(
try setupXdgDataDirs(alloc_arena, resource_dir, env);
break :shell .{
.shell = .elvish,
.command = command,
.command = try alloc_arena.dupe(u8, command),
};
}
@ -86,7 +86,7 @@ pub fn setup(
try setupXdgDataDirs(alloc_arena, resource_dir, env);
break :shell .{
.shell = .fish,
.command = command,
.command = try alloc_arena.dupe(u8, command),
};
}
@ -94,7 +94,7 @@ pub fn setup(
try setupZsh(resource_dir, env);
break :shell .{
.shell = .zsh,
.command = command,
.command = try alloc_arena.dupe(u8, command),
};
}