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:
Andrew Tridgell 2022-10-14 07:24:20 +11:00
parent 1be58e632b
commit 41db7a1998
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}