mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
Merge pull request #11529 from lat9nq/no-oob-names-pls
mii_types: Remove null terminator check
This commit is contained in:
commit
e18ff5cb4e
1 changed files with 1 additions and 4 deletions
|
@ -606,15 +606,12 @@ struct Nickname {
|
||||||
static constexpr std::size_t MaxNameSize = 10;
|
static constexpr std::size_t MaxNameSize = 10;
|
||||||
std::array<char16_t, MaxNameSize> data;
|
std::array<char16_t, MaxNameSize> data;
|
||||||
|
|
||||||
// Checks for null, non-zero terminated or dirty strings
|
// Checks for null or dirty strings
|
||||||
bool IsValid() const {
|
bool IsValid() const {
|
||||||
if (data[0] == 0) {
|
if (data[0] == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[MaxNameSize] != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
std::size_t index = 1;
|
std::size_t index = 1;
|
||||||
while (data[index] != 0) {
|
while (data[index] != 0) {
|
||||||
index++;
|
index++;
|
||||||
|
|
Loading…
Reference in a new issue