diff options
| author | 2023-09-17 15:23:57 -0400 | |
|---|---|---|
| committer | 2023-09-17 15:23:57 -0400 | |
| commit | 77682aabd3a8c4dbda3dd20421a5dea16b6ef86d (patch) | |
| tree | 49b2f189ca12a0b65169794ddd072f4cb1a734ff /src/core | |
| parent | Merge pull request #11524 from t895/signing-ci (diff) | |
| download | yuzu-77682aabd3a8c4dbda3dd20421a5dea16b6ef86d.tar.gz yuzu-77682aabd3a8c4dbda3dd20421a5dea16b6ef86d.tar.xz yuzu-77682aabd3a8c4dbda3dd20421a5dea16b6ef86d.zip | |
mii_types: Remove null terminator check
This is an OoB array access, causing a crash on at least the Linux
Flatpak releases.
Co-authored-by: german77 <juangerman-13@hotmail.com>
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/mii/mii_types.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/hle/service/mii/mii_types.h b/src/core/hle/service/mii/mii_types.h index 95476f745..611ff4f81 100644 --- a/src/core/hle/service/mii/mii_types.h +++ b/src/core/hle/service/mii/mii_types.h | |||
| @@ -606,15 +606,12 @@ struct Nickname { | |||
| 606 | static constexpr std::size_t MaxNameSize = 10; | 606 | static constexpr std::size_t MaxNameSize = 10; |
| 607 | std::array<char16_t, MaxNameSize> data; | 607 | std::array<char16_t, MaxNameSize> data; |
| 608 | 608 | ||
| 609 | // Checks for null, non-zero terminated or dirty strings | 609 | // Checks for null or dirty strings |
| 610 | bool IsValid() const { | 610 | bool IsValid() const { |
| 611 | if (data[0] == 0) { | 611 | if (data[0] == 0) { |
| 612 | return false; | 612 | return false; |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | if (data[MaxNameSize] != 0) { | ||
| 616 | return false; | ||
| 617 | } | ||
| 618 | std::size_t index = 1; | 615 | std::size_t index = 1; |
| 619 | while (data[index] != 0) { | 616 | while (data[index] != 0) { |
| 620 | index++; | 617 | index++; |