mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-28 00:35:47 +00:00
fix(libSceLibcInternal): check null output before path in statvfs
This commit is contained in:
1 parent
c2b0159d6e
commit
a8c5a3afc8
2 files changed
+3
-1
No files matched your search
@@ -140,7 +140,7 @@ int OpenMetadata(const std::filesystem::path& path, bool directory) {
|
||||
}
|
||||
|
||||
extern "C" int APS5_VABI statvfs_nid_postfix(const char* path, LibcStatvfs* output) {
|
||||
if (path == nullptr) return Fail(14);
|
||||
if (path == nullptr || output == nullptr) return Fail(14);
|
||||
if (*path == '\0') return Fail(2);
|
||||
const int saved = errno;
|
||||
const auto last = std::string_view(path).back();
|
||||
|
||||
@@ -102,6 +102,8 @@ int main() {
|
||||
RemovePathAlias_nid_no_patch("/anyps5-statvfs-unavailable");
|
||||
Require(statvfs_nid_postfix("/anyps5-statvfs-test/file.txt", nullptr) == -1);
|
||||
Require(*__error_nid_postfix() == 14);
|
||||
Require(statvfs_nid_postfix("/anyps5-statvfs-test/missing", nullptr) == -1);
|
||||
Require(*__error_nid_postfix() == 14);
|
||||
|
||||
const auto unicodeFile = root / std::filesystem::path(u8"\u65e5.txt");
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user