Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve robustness of some newlib functions #54

Closed
wants to merge 1 commit into from
Closed

Improve robustness of some newlib functions #54

wants to merge 1 commit into from

Conversation

ekeeke
Copy link

@ekeeke ekeeke commented Apr 1, 2021

Crash can occur if those functions are called with a relative path before defaultDevice has been correctly initialized or with an unmounted device path.

It has been observed in Wii homebrew loaded with Wiiflow that crashes with a DSI exception when mkdir function is called because fatInitDefault() function failed to set defaultDevice (through chdir) using the application path provided in argv[0] by the loader (see ekeeke/Genesis-Plus-GX#357 and Fledge68/WiiFlow_Lite#254)

These changes improve the robustness of functions mkdir, link and rename against such edge case, similarly to what is already done for other syscall functions.

…verifying if returned value is a valid device id
@WinterMute
Copy link
Member

Newlib patchset is maintained at https://github.com/devkitPro/newlib/tree/devkitPPC

@WinterMute WinterMute closed this Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants