Support and General Use > Audio Playback, Database and Playlists

Database list size (e.g. artists/albums) > global_settings.max_files_in_dir

<< < (2/3) > >>

chris_s:
Wow, you're fast.  That's great. :) To clarify though   – looking at load_root(struct tree_context *c) in apps/tagtree.c , where the dptr pointer is incremented for as many times as the menu has entries, it still looks it will happily write to memory areas outside of the originally allocated one, if max_files_in_dir hasn't been set to a sufficiently large value. Is that a correct assumption, or am I misunderstanding things (still in the process of getting a better handle on C programming & the Rockbox codebase) ?



--- Code: --- struct tagentry *dptr = core_get_data(c->cache.entries_handle);
   #(...)
    for (i = 0; i < menu->itemcount; i++)
    {
        dptr->name = menu->items[i]->name;
       #(...)
     dptr++;
    }
--- End code ---
https://github.com/Rockbox/rockbox/blob/f08d218e676f9ee8b5c26e755088671baf3a70b7/apps/tagtree.c#L1616



--- Code: ---cache->max_entries = global_settings.max_files_in_dir;
    cache->entries_handle = core_alloc_ex("tree entries",
                                    cache->max_entries*(sizeof(struct entry)),
                                    &ops);
--- End code ---
https://github.com/Rockbox/rockbox/blob/f08d218e676f9ee8b5c26e755088671baf3a70b7/apps/tree.c#L1083

chris_s:
ok, I'm dumb since that's just the root menu... but looks like something similar is happening in retrieve_entries?

https://github.com/Rockbox/rockbox/blob/f08d218e676f9ee8b5c26e755088671baf3a70b7/apps/tagtree.c#L1329

chris_s:
ugh, should have read the code.... Guess it's handled...? :P


--- Code: --- if (current_entry_count >= c->cache.max_entries)
        {
            logf("chunk mode #3: %d", current_entry_count);
            c->dirfull = true;
            sort = false;
            break ;
        }
--- End code ---

Bilgus:
In load_root yes it could in theory but i'm not sure how likely it is to be greater than 50 entries
still probably worthwhile to explicitly check through tree_get_entry_at()
Edit: looks like it uses a different struct

retrieve_entries looks safe it adds a few entries before checking but the min is 50 so nbd.
https://github.com/Rockbox/rockbox/blob/master/apps/tagtree.c#L1537

chris_s:
Thanks!   :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version