Browse Source
Merge pull request #11529 from lat9nq/no-oob-names-pls
mii_types: Remove null terminator check
pull/15/merge
Narr the Reg
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
4 deletions
-
src/core/hle/service/mii/mii_types.h
|
|
|
@ -606,15 +606,12 @@ struct Nickname { |
|
|
|
static constexpr std::size_t MaxNameSize = 10; |
|
|
|
std::array<char16_t, MaxNameSize> data; |
|
|
|
|
|
|
|
// Checks for null, non-zero terminated or dirty strings |
|
|
|
// Checks for null or dirty strings |
|
|
|
bool IsValid() const { |
|
|
|
if (data[0] == 0) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (data[MaxNameSize] != 0) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
std::size_t index = 1; |
|
|
|
while (data[index] != 0) { |
|
|
|
index++; |
|
|
|
|