From 17e23b678dac2e4579e714705cec137b351f7e9b Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 4 Jul 2021 23:01:13 +0800 Subject: 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 Reviewed-by: Anup Patel --- platform/generic/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/generic/platform.c b/platform/generic/platform.c index da0c1af..79d5230 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -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); -- cgit v1.2.3