* Fix #11644: Off by one error in StrMakeValid UTF-8 decode overrun detection * Fix #11644: Off by one error in StrMakeValid buffer last character * Fix: Unnecessary string duplication at StrMakeValid call sites
This commit is contained in:

committed by
GitHub

parent
a672813bb0
commit
88324a253e
@@ -486,7 +486,7 @@ static std::string ExtractString(char *buffer, size_t buffer_length)
|
||||
{
|
||||
size_t length = 0;
|
||||
for (; length < buffer_length && buffer[length] != '\0'; length++) {}
|
||||
return StrMakeValid(std::string(buffer, length));
|
||||
return StrMakeValid(std::string_view(buffer, length));
|
||||
}
|
||||
|
||||
bool TarScanner::AddFile(const std::string &filename, size_t, [[maybe_unused]] const std::string &tar_filename)
|
||||
|
Reference in New Issue
Block a user