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
781fed2390
commit
19d444bb3a
|
@ -181,7 +181,7 @@ void GCS_MAVLINK::ftp_worker(void) {
|
|||
while (true) {
|
||||
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
|
||||
hal.scheduler->delay(2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue