Skip to content

Commit b62a4aa

Browse files
committed
Swift: include null terminators into the invocation file hash
1 parent 433f4e0 commit b62a4aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swift/extractor/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void checkWhetherToRunUnderTool(int argc, char* const* argv) {
109109
codeql::TargetFile invocationTargetFile(codeql::SwiftExtractorConfiguration& configuration) {
110110
auto hasher = picosha2::hash256_one_by_one();
111111
for (auto& option : configuration.frontendOptions) {
112-
hasher.process(std::begin(option), std::end(option));
112+
hasher.process(option.c_str(), option.c_str() + option.size() + 1);
113113
}
114114
hasher.finish();
115115
auto target = "invocation-"s + get_hash_hex_string(hasher);

0 commit comments

Comments
 (0)