rt-thread/components/dfs/dfs_v2
Shell 5f947863b4
[dfsv2] fixup out-of-memory access (#8973)
This change addresses a potential out-of-memory access issue in the
devfs filesystem component. The issue arises when the `rt_malloc`
function allocates memory for a path string without accounting for
the null terminator, leading to undefined behavior.

As the manual documented:

> DESCRIPTION
>   The strlen() function calculates the length of the string pointed to
>   by s, excluding the terminating null byte ('\0').

To fix this, the memory allocation size was increased by one byte
to ensure space for the null terminator. This prevents potential
out-of-memory access and ensures proper string termination.

Signed-off-by: Shell <smokewood@qq.com>
2024-05-21 19:45:08 +08:00
..
filesystems [dfsv2] fixup out-of-memory access (#8973) 2024-05-21 19:45:08 +08:00
include [dfsv2] add dfs pwrite pread 2024-04-09 22:26:58 -04:00
src fix file mmap (#8865) 2024-04-28 15:21:02 +08:00
SConscript Sync dfs lwp (#8123) 2023-10-17 13:07:59 +08:00