diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp index 9dc0c85..f2002d0 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp @@ -185,7 +185,9 @@ 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 @@ out[len++] = src[i+j]; } out[len] = 0; - *out_len = len; + if (out_len != nullptr) { + *out_len = len; + } return ResultFsTooLongPath; } } @@ -249,7 +253,9 @@ /* NULL terminate. */ out[len] = 0; - *out_len = len; + if (out_len != nullptr) { + *out_len = len; + } /* Assert normalized. */ bool normalized = false;