1
0
Fork 0

Fix 208952f: incorrect truncation in string setting validation

pull/12924/head
Rubidium 2024-09-02 21:23:39 +02:00
parent b80f205967
commit e67e9c3f8b
1 changed files with 1 additions and 1 deletions

View File

@ -578,7 +578,7 @@ void StringSettingDesc::MakeValueValid(std::string &str) const
/* In case a maximum length is imposed by the setting, the length /* In case a maximum length is imposed by the setting, the length
* includes the '\0' termination for network transfer purposes. * includes the '\0' termination for network transfer purposes.
* Also ensure the string is valid after chopping of some bytes. */ * Also ensure the string is valid after chopping of some bytes. */
std::string stdstr(str, this->max_length - 1); std::string stdstr(str, 0, this->max_length - 1);
str.assign(StrMakeValid(stdstr, SVS_NONE)); str.assign(StrMakeValid(stdstr, SVS_NONE));
} }