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:
parent
a4935b4a0d
commit
bdeecdd095
@ -48,6 +48,12 @@ int main(int argc, char* argv[])
|
|||||||
std::vector<volk_gnsssdr_test_results_t> results;
|
std::vector<volk_gnsssdr_test_results_t> results;
|
||||||
if (argc > 1)
|
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)
|
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
||||||
{
|
{
|
||||||
if (std::string(argv[1]) == test_cases[ii].name())
|
if (std::string(argv[1]) == test_cases[ii].name())
|
||||||
|
Loading…
Reference in New Issue
Block a user