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

Avoid dereference before null check

This commit is contained in:
Carles Fernandez 2018-05-22 00:32:00 +02:00
parent bdce3c20d1
commit bc86d7d665
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -1965,7 +1965,7 @@ bool Gnuplot::get_program_path()
path = std::getenv("PATH");
char secured_path[4096];
size_t len = strlen(path);
if (path && len < 4046 * sizeof(char))
if (len > 0 && len < 4046 * sizeof(char))
{
strncpy(secured_path, path, sizeof(secured_path));
}