mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00

In the original implementation of `sbi_strcpy` and `sbi_strncpy`, if the destination buffer (`dest`) was longer than the source string (`src`), the functions did not ensure that the remaining bytes in `dest` were properly null-terminated. This could result in garbage data being present in the destination buffer after the copy operation, as the functions only copied characters from `src` without explicitly terminating `dest`. Signed-off-by: Dongdong Zhang <zhangdongdong@eswincomputing.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>