Merge branch 'contrib/github_pr_18823' into 'master'

fix(vfs): use MAX_FDS instead of VFS_MAX_COUNT when clearing fd table on unregister (GitHub PR)

Closes IDFGH-17954, IDF-15868, and SEC-254

See merge request espressif/esp-idf!50678
This commit is contained in:
Martin Vychodil
2026-07-17 16:40:46 +08:00
+1 -1
View File
@@ -589,7 +589,7 @@ esp_err_t esp_vfs_unregister_with_id(esp_vfs_id_t vfs_id)
_lock_acquire(&s_fd_table_lock);
// Delete all references from the FD lookup-table
for (int j = 0; j < VFS_MAX_COUNT; ++j) {
for (int j = 0; j < MAX_FDS; ++j) {
if (s_fd_table[j].vfs_index == vfs_id) {
s_fd_table[j] = FD_TABLE_ENTRY_UNUSED;
}