Skip to content
Snippets Groups Projects
Commit af96cc40 authored by Tobias Leibner's avatar Tobias Leibner
Browse files

Silence clang-tidy warning

parent db841d86
No related branches found
No related tags found
1 merge request!92Apply clang tidy, use -Werror on CI
......@@ -196,7 +196,10 @@ static inline char** vector_to_main_args(const std::vector<std::string>& args)
char** argv = new char*[args.size()];
for (auto ii : value_range(args.size())) {
argv[ii] = new char[args[ii].length() + 1];
strcpy(argv[ii], args[ii].c_str());
// clang-tidy complains that strcpy is insecure because it does not provide bounding of the memory buffer.
// However, the usage here seems fine and I did not find a more secure standard replacement, so we just
// silence the warning here.
strcpy(argv[ii], args[ii].c_str()); // NOLINT(clang-analyzer-security.insecureAPI.strcpy)
}
return argv;
} // ... vector_to_main_args(...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment