drivers/gps: fix segfault when parsing arguments

running gps command without parameters results in segfault
due to illegal access to unallocated memory

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
This commit is contained in:
Nicolae Rosia
2016-04-20 21:50:10 +02:00
committed by Lorenz Meier
parent df3dce33c7
commit fff535857d
+4
View File
@@ -631,6 +631,10 @@ gps_main(int argc, char *argv[])
bool fake_gps = false;
bool enable_sat_info = false;
if (argc < 2) {
goto out;
}
/*
* Start/load the driver.
*/