1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(mem): memory access out of range in lv_strncpy_builtin (#3956)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu 2023-02-01 17:57:04 +08:00 committed by GitHub
parent 53a6d04504
commit 977192b736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,7 +161,7 @@ size_t lv_strlen_builtin(const char * str)
char * lv_strncpy_builtin(char * dst, const char * src, size_t dest_size)
{
size_t i;
for(i = 0; i < dest_size - 1 && *src; i++) {
for(i = 0; i < dest_size - 1 && src[i]; i++) {
dst[i] = src[i];
}
dst[i] = '\0';