1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-04 17:57:03 +00:00

Avoid null pointer argument in call to string comparison function

This commit is contained in:
Carles Fernandez 2019-08-13 13:52:43 +02:00
parent c04ec18ef7
commit 8867a9327c
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

@ -388,13 +388,16 @@ int decode_nmea(char *buff, sol_t *sol)
}
}
/* decode nmea sentence */
if (!strcmp(val[0], "$GPRMC"))
if (val[0])
{
return decode_nmearmc(val + 1, n - 1, sol);
}
if (!strcmp(val[0], "$GPGGA"))
{
return decode_nmeagga(val + 1, n - 1, sol);
if (!strcmp(val[0], "$GPRMC"))
{
return decode_nmearmc(val + 1, n - 1, sol);
}
if (!strcmp(val[0], "$GPGGA"))
{
return decode_nmeagga(val + 1, n - 1, sol);
}
}
return 0;
}