Skip to content

Doing a mkdir on devices not in the devoptab results in a crash #36

@mrpapersonic

Description

@mrpapersonic

Bug Report

What's the issue you encountered?

I was attempting to add support for external USB drives within Schism Tracker and came upon a crash; setting a breakpoint in Cemu shows that the crash was in mkdir after a call to FindDevice. This bug can be seen more explicitly in the source code:

int dev = FindDevice(path);
ret = -1;
if (devoptab_list[dev]->mkdir_r) {

There is no check for whether FindDevice actually returns a valid device.

How can the issue be reproduced?

int main(void)
{
        mkdir("fake:/test");
}

Environment?

Latest versions of devkitPPC and wut directly from devkitpro pacman repos. I'm using Arch Linux, but this can also be replicated on recent GitHub Actions builds using devkitPPC docker containers.

Additional context?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions