mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-14 00:56:35 +00:00
fs.mitm: fix null deref
This commit is contained in:
parent
9d5ca47ac8
commit
22d4de27f1
1 changed files with 9 additions and 3 deletions
|
@ -185,7 +185,9 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s
|
|||
if (!skip_next_sep) {
|
||||
if (len + 1 == max_out_size) {
|
||||
out[len] = 0;
|
||||
*out_len = len;
|
||||
if (out_len != nullptr) {
|
||||
*out_len = len;
|
||||
}
|
||||
return ResultFsTooLongPath;
|
||||
}
|
||||
|
||||
|
@ -227,7 +229,9 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s
|
|||
out[len++] = src[i+j];
|
||||
}
|
||||
out[len] = 0;
|
||||
*out_len = len;
|
||||
if (out_len != nullptr) {
|
||||
*out_len = len;
|
||||
}
|
||||
return ResultFsTooLongPath;
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +253,9 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s
|
|||
|
||||
/* NULL terminate. */
|
||||
out[len] = 0;
|
||||
*out_len = len;
|
||||
if (out_len != nullptr) {
|
||||
*out_len = len;
|
||||
}
|
||||
|
||||
/* Assert normalized. */
|
||||
bool normalized = false;
|
||||
|
|
Loading…
Reference in a new issue