Jump to content

Possible bug in the file gfile_fs_fatfs.c ?


Serg_pr

Recommended Posts

Probably in the file gfile_fs_fatfs.c there is a bug, namely in the functions -
FatfsExists and fatfsFileSize when the LFN option is enabled.
This was tested on the Nucleo F401RE board without the OS.
Sometimes when you call fatfsExists or fatfsFileSize, HARDFAULT appears.
Analysis of the execution of the program code showed that inside the FATFS library
There is a call to the uninitialized pointer fno.lfname.

Therefore, in the functions - fatfsExists and fatfsFileSize it is enough to add this code:

#if _USE_LFN

   Fno.lfname = 0;
   Fno.lfsize = 0;

#endif

If I'm wrong somewhere, then correct me.

Thank you in advance!
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...