* Helper to extract a string for the tar header. We must assume that the tar * header contains garbage and is malicious. So, we cannot rely on the string * being properly terminated. * As such, do not use strlen to determine the actual length (explicitly or * implicitly via the std::string constructor), but pass the buffer bounds * explicitly. * @param buffer The buffer to read from. * @ret
| 433 | * @return The string data. |
| 434 | */ |
| 435 | static std::string ExtractString(std::span<char> buffer) |
| 436 | { |
| 437 | return StrMakeValid(std::string_view(buffer.begin(), buffer.end())); |
| 438 | } |
| 439 | |
| 440 | bool TarScanner::AddFile(const std::string &filename, size_t, [[maybe_unused]] const std::string &tar_filename) |
| 441 | { |
no test coverage detected