vgmoose / wiiu-hbas

[Wii U] Homebrew App Store - download apps for HBL (Legacy)
GNU General Public License v3.0
78 stars 11 forks source link

Elfs in /wiiu/apps cause soft-lock #14

Closed vgmoose closed 7 years ago

vgmoose commented 8 years ago

It appears that if an elf is placed directly in sd:/wiiu/apps that no apps will load from the server.

To reproduce: Put any elf directly in /wiiu/apps, for example, having the file sd:/wiiu/apps/boot.elf will cause a soft-lock

To fix: Put the elf in a folder in /wiiu/apps, for example, sd:/wiiu/apps/boot/boot.elf

Target Milestone 1.5

vgmoose commented 8 years ago

I really need to fix this, I keep triggering it accidentally:

The issue looks like it mainly stems from not checking the xmlReadSuccess boolean before trying to perform operations on the xml data.

CreeperMario commented 8 years ago

On line 162, we can see:

homebrewButtons[idx].shortname = homebrewPath.substr(14);

I assume this creates a string along the lines of "appstore/hbas.elf"

If that's the case, would it not be possible to check that string for forward slashes, and "continue" if there aren't any?

I'm probably missing something, but there's my thought.

Maybe something like this? (Probably wrong, but its a start).

if(homebrewButtons[idx].shortname.find_first_of("/") == -1) {
    // perform stuff to remove the current tile, as it points to an invalid app
    continue;
}

Of course, this doesn't fix the bug, it just prevents the bug from happening. 😝