mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
filetree.c fix null entry check fs#13222
behavior found on xduoo x3 I had already fixed this once but I was checking entry instead of dptr :( Change-Id: Iff76a0d6796f270118dd460fb424e35e213e4030
This commit is contained in:
parent
6099767a18
commit
5dd4c00697
1 changed files with 5 additions and 3 deletions
|
@ -297,8 +297,11 @@ int ft_load(struct tree_context* c, const char* tempdir)
|
||||||
int len;
|
int len;
|
||||||
struct dirinfo info;
|
struct dirinfo info;
|
||||||
struct entry* dptr = tree_get_entry_at(c, files_in_dir);
|
struct entry* dptr = tree_get_entry_at(c, files_in_dir);
|
||||||
if (!entry)
|
if (!dptr)
|
||||||
|
{
|
||||||
|
c->dirfull = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
info = dir_get_info(dir, entry);
|
info = dir_get_info(dir, entry);
|
||||||
len = strlen((char *)entry->d_name);
|
len = strlen((char *)entry->d_name);
|
||||||
|
@ -364,8 +367,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((len > c->cache.name_buffer_size - name_buffer_used - 1) ||
|
if (len > c->cache.name_buffer_size - name_buffer_used - 1) {
|
||||||
(files_in_dir >= c->cache.max_entries)) {
|
|
||||||
/* Tell the world that we ran out of buffer space */
|
/* Tell the world that we ran out of buffer space */
|
||||||
c->dirfull = true;
|
c->dirfull = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue