1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Try to fix Coverity Scan complain about tainted data

This commit is contained in:
Carles Fernandez 2018-03-26 19:46:08 +02:00
parent a4935b4a0d
commit bdeecdd095

View File

@ -48,6 +48,12 @@ int main(int argc, char* argv[])
std::vector<volk_gnsssdr_test_results_t> results;
if (argc > 1)
{
const size_t len = std::char_traits<char>::length(argv[1]);
if (len == 0 || len > 2046)
{
std::cerr << "Test name is too long." << std::endl;
return 0;
}
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
{
if (std::string(argv[1]) == test_cases[ii].name())