You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, great project!
I found that in the lv_fs_if/lv_fs_pc.c file, there is no length limit for "oldname" and "newname", and sprintf them directly into a fixed-length stack buffer, which may lead to overflow. Although the filename length is limited to 255 bytes on linux, the path length can be up to 4096 bytes.
/** * Rename a file * @param drv pointer to a driver where this function belongs * @param oldname path to the file * @param newname path with the new name * @return LV_FS_RES_OK or any error from 'fs_res_t' */staticlv_fs_res_tfs_rename (lv_fs_drv_t*drv, constchar*oldname, constchar*newname)
{
(void) drv; /*Unused*/staticcharnew[512];
staticcharold[512];
sprintf(old, LV_FS_PC_PATH"/%s", oldname);
sprintf(new, LV_FS_PC_PATH"/%s", newname);
intr=rename(old, new);
if(r==0) returnLV_FS_RES_OK;
elsereturnLV_FS_RES_UNKNOWN;
}
The text was updated successfully, but these errors were encountered:
hi, great project!
I found that in the
lv_fs_if/lv_fs_pc.c
file, there is no length limit for "oldname" and "newname", and sprintf them directly into a fixed-length stack buffer, which may lead to overflow. Although the filename length is limited to 255 bytes on linux, the path length can be up to 4096 bytes.The text was updated successfully, but these errors were encountered: