mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
platform: generic: Terminate platform.name with null
fw_platform_init() fills platform.name without considering the ending null character. Fix it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -85,7 +85,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
|
||||
|
||||
model = fdt_getprop(fdt, root_offset, "model", &len);
|
||||
if (model)
|
||||
sbi_strncpy(platform.name, model, sizeof(platform.name));
|
||||
sbi_strncpy(platform.name, model, sizeof(platform.name) - 1);
|
||||
|
||||
if (generic_plat && generic_plat->features)
|
||||
platform.features = generic_plat->features(generic_plat_match);
|
||||
|
Reference in New Issue
Block a user