From e1274af0eae0ebbe4031160887b9e3351cb78345 Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:55:41 +0200 Subject: [PATCH] Fix empty paths --- source/devoptab/devoptab_fsa_utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/devoptab/devoptab_fsa_utils.cpp b/source/devoptab/devoptab_fsa_utils.cpp index 4afe577..5f97ffa 100644 --- a/source/devoptab/devoptab_fsa_utils.cpp +++ b/source/devoptab/devoptab_fsa_utils.cpp @@ -16,11 +16,17 @@ __fsa_fixpath(struct _reent *r, p = (char *) path; } - if (strlen(p) > FS_MAX_PATH) { + uint32_t sizePath = strlen(p); + if (sizePath > FS_MAX_PATH) { r->_errno = ENAMETOOLONG; return nullptr; } + if (sizePath == 0) { + r->_errno = ENOENT; + return nullptr; + } + fixedPath = (char *) memalign(0x40, FS_MAX_PATH + 1); if (!fixedPath) { r->_errno = ENOMEM;