Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(components/fatfs): possible array index out of bounds (IDFGH-14474) #15248

Open
3 tasks done
safocl opened this issue Jan 21, 2025 · 1 comment
Open
3 tasks done

(components/fatfs): possible array index out of bounds (IDFGH-14474) #15248

safocl opened this issue Jan 21, 2025 · 1 comment
Assignees
Labels
Status: Opened Issue is new

Comments

@safocl
Copy link

safocl commented Jan 21, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

The functions in components/fatfs/diskio/diskio_wl.c potentially may produce access to out of bounds of ff_wl_handles array:

wl_handle_t wl_handle = ff_wl_handles[pdrv];
(and other lines)

ff_wl_handles array defined here:

wl_handle_t ff_wl_handles[FF_VOLUMES] = {

pdrv is a function argument and it is not checked to be less than FF_VOLUMES value (that puts from the configuration files).

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 21, 2025
@github-actions github-actions bot changed the title (components/fatfs): possible array index out of bounds (components/fatfs): possible array index out of bounds (IDFGH-14474) Jan 21, 2025
@safocl
Copy link
Author

safocl commented Jan 21, 2025

this check exists here.

if (pdrv >= FF_VOLUMES) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants