mirror of https://github.com/ArduPilot/ardupilot
GCS_MAVLink: prevent segv in ftp
if the user disables ftp by changing BRD_OPTIONS after ftp has started then we could dereference a nullptr
This commit is contained in:
parent
1be58e632b
commit
41db7a1998
|
@ -181,7 +181,7 @@ void GCS_MAVLINK::ftp_worker(void) {
|
||||||
while (true) {
|
while (true) {
|
||||||
bool skip_push_reply = false;
|
bool skip_push_reply = false;
|
||||||
|
|
||||||
while (!ftp.requests->pop(request)) {
|
while (ftp.requests == nullptr || !ftp.requests->pop(request)) {
|
||||||
// nothing to handle, delay ourselves a bit then check again. Ideally we'd use conditional waits here
|
// nothing to handle, delay ourselves a bit then check again. Ideally we'd use conditional waits here
|
||||||
hal.scheduler->delay(2);
|
hal.scheduler->delay(2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue