Commit Graph

5 Commits

Author SHA1 Message Date
iabdalkader
ccf6f14e7e common/file_utils: Fix file utils.
- Fix broken buffer_off/on, close etc..

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-10-15 21:01:29 +02:00
iabdalkader
34687cda83 common/file_utils: Check fp in all public functions.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-10-15 17:01:46 +02:00
Andrew Leech
cd10451d49 common: Fix NULL pointer dereference and recursion bugs.
Addresses review feedback from PR #2870:

- Fix NULL pointer dereference when finalisers run on unopened files
- Prevent infinite recursion in error handlers during buffered I/O
- Add explicit validation for FA_READ|FA_WRITE flag combinations
- Switch to mp_vfs_open for consistency with VFS abstraction
- Add NULL checks to file_buffer_on/off public APIs

The recursion fix ensures both file_buffer_off() and file_close()
clear their state before risky operations, making re-entry safe.
2025-10-14 12:17:12 +11:00
Andrew Leech
f54fa0c0a2 common: Replace FatFS calls with VFS abstraction.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-10-14 12:16:16 +11:00
iabdalkader
daf2bb30da misc: Restructure repo.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-13 08:28:34 +02:00