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:
William Wilgus 2020-08-24 13:22:00 -04:00 committed by William Wilgus
parent 6099767a18
commit 5dd4c00697

View file

@ -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;