platform: generic: Terminate platform.name with null
PATCH 1/1 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 <[email protected]>
---
platform/generic/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
platform/generic/platform.c +1 -1
@@ -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);
Signature · 1 line
2.25.1
Anup Patel
AppliedPATCH 1/1 platform: generic: Terminate platform.name with null
Quoted 5 lines · Bin Meng
fw_platform_init()fills platform.name without considering the ending null character. Fix it.Signed-off-by Bin Meng <[email protected]>
Looks good to me.
Reviewed-by Anup Patel <[email protected]>
Applied this patch to the riscv/opensbi repo
Thanks,
Anup
Quoted 26 lines
---
platform/generic/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)platform/generic/platform.c +1
-2@@ -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); --2.25.1
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi