1
0
Fork 0
forked from len0rd/rockbox

[COV] tree.c rockbox_browse potential NULL deref

ultimately its only used as a way to prevent reentry
but coverity correctly identified the possibility..

Change-Id: I4738e52782ad4cac6134394238345a0491a50382
This commit is contained in:
William Wilgus 2024-11-29 00:25:03 -05:00
parent c2bc7aa516
commit 4ce8963c50

View file

@ -1064,8 +1064,14 @@ int rockbox_browse(struct browse_context *browse)
{
tc.is_browsing = (browse != NULL);
int ret_val = 0;
int dirfilter = tc.is_browsing ? browse->dirfilter : SHOW_ALL;
int dirfilter = SHOW_ALL;
if (tc.is_browsing)
dirfilter = browse->dirfilter;
else
{
debugf("%s browse is [NULL] \n", __func__);
browse = tc.browse;
}
if (backup_count >= NUM_TC_BACKUP)
return GO_TO_PREVIOUS;
if (backup_count >= 0)