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:
parent
53a6d04504
commit
977192b736
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user