From 70cc2d9793e87567560b56d03f42dcab0f8583f9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 23 Nov 2024 09:40:00 -0800 Subject: [PATCH] termio: copy input command to avoid memory corruption Fixes #2779 --- src/termio/shell_integration.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/termio/shell_integration.zig b/src/termio/shell_integration.zig index cd4d88dce..06f2abc67 100644 --- a/src/termio/shell_integration.zig +++ b/src/termio/shell_integration.zig @@ -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), }; }