forked from Archive/PX4-Autopilot
fix sf0x: check if device port is given
otherwise we risk dereferencing a null pointer
This commit is contained in:
parent
bbe15aa61a
commit
5a26f06f8a
|
@ -48,6 +48,11 @@ static int start(const char *port, uint8_t rotation)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (port == nullptr) {
|
||||
PX4_ERR("no device specified");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* create the driver */
|
||||
g_dev = new SF0X(port, rotation);
|
||||
|
||||
|
|
Loading…
Reference in New Issue