Swift: include null terminators into the invocation file hash

This commit is contained in:
Alex Denisov
2022-11-03 15:23:12 +01:00
parent 433f4e0cb5
commit b62a4aae1a

View File

@@ -109,7 +109,7 @@ static void checkWhetherToRunUnderTool(int argc, char* const* argv) {
codeql::TargetFile invocationTargetFile(codeql::SwiftExtractorConfiguration& configuration) {
auto hasher = picosha2::hash256_one_by_one();
for (auto& option : configuration.frontendOptions) {
hasher.process(std::begin(option), std::end(option));
hasher.process(option.c_str(), option.c_str() + option.size() + 1);
}
hasher.finish();
auto target = "invocation-"s + get_hash_hex_string(hasher);