Fix using uninitialized variable when formatting config_path. (#4129)

Close: #4128
This commit is contained in:
Ai Hoshino
2023-08-12 13:14:08 +08:00
committed by GitHub
parent ca26780b27
commit b94433ce86
2 changed files with 21 additions and 1 deletions

View File

@@ -313,7 +313,7 @@ pub const Arguments = struct {
defer ctx.debug.loaded_bunfig = true;
var config_path: [:0]u8 = undefined;
if (config_path_[0] == '/') {
@memcpy(config_buf[0..config_path.len], config_path);
@memcpy(config_buf[0..config_path_.len], config_path_);
config_buf[config_path_.len] = 0;
config_path = config_buf[0..config_path_.len :0];
} else {