mirror of
https://github.com/apache/nuttx.git
synced 2026-10-23 14:58:47 +00:00
fs/romfs: fix node cache overflow in directories with >256 entries
romfs_cachenode() tracked the allocated size of rn_child in a uint8_t while rn_count is a uint16_t. Past 256 entries the size wraps to zero, the grow condition rn_count == num - 1 can never be true again and the array is not reallocated: entries are written beyond the allocation, corrupting the heap. Track the allocated size in a size_t. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code
This commit is contained in:
parent
46e0f6f698
commit
427ad36315
1 changed files with 1 additions and 1 deletions
|
|
@ -417,7 +417,7 @@ static int romfs_cachenode(FAR struct romfs_mountpt_s *rm,
|
|||
char childname[NAME_MAX + 1];
|
||||
uint32_t linkoffset;
|
||||
uint32_t info;
|
||||
uint8_t num = 0;
|
||||
size_t num = 0;
|
||||
size_t nsize;
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue