mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 18:13:34 +08:00
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:
committed by
Lorenz Meier
parent
df3dce33c7
commit
fff535857d
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user