summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-08-24 13:22:00 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2020-08-25 03:33:24 +0000
commit5dd4c006976130ebc3fd6309be3767614f666728 (patch)
tree74e9713d498e7e87912e1a439773dc4af9ce82cf /apps
parent6099767a18d82e9ff8bdd701906e842f8a81d4a9 (diff)
downloadrockbox-5dd4c006976130ebc3fd6309be3767614f666728.tar.gz
rockbox-5dd4c006976130ebc3fd6309be3767614f666728.tar.bz2
rockbox-5dd4c006976130ebc3fd6309be3767614f666728.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/filetree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index cfa14f86b5..9279f84c17 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -297,8 +297,11 @@ int ft_load(struct tree_context* c, const char* tempdir)
int len;
struct dirinfo info;
struct entry* dptr = tree_get_entry_at(c, files_in_dir);
- if (!entry)
+ if (!dptr)
+ {
+ c->dirfull = true;
break;
+ }
info = dir_get_info(dir, entry);
len = strlen((char *)entry->d_name);
@@ -364,8 +367,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
continue;
}
- if ((len > c->cache.name_buffer_size - name_buffer_used - 1) ||
- (files_in_dir >= c->cache.max_entries)) {
+ if (len > c->cache.name_buffer_size - name_buffer_used - 1) {
/* Tell the world that we ran out of buffer space */
c->dirfull = true;
break;