This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

File system crashes when no file on SD card

Hello,

we bought the sources of the file system and I think I found a bug in the sources (bug in all releases to 7.3.0) :

When there are no files in the SD card, the file system crashes in function "elink_rewind" of file "fs_fat_elink" because "el" local variable is initialized to 0 and used as pointer further.

Add the code below to fix the bug :

static ELINK *elink_rewind (uint32_t dir, ELINK_CACHE_CB *nc) {
  ELINK *el;

  el = nc->Used[nc->Depth].Oldest;

        if (el == NULL)
        {
                return NULL;
        }

  if (dir <= el->Info.DirClus) {