GCS_MAVLink: prevent devop larger than buffer

This commit is contained in:
Andrew Tridgell 2022-04-03 08:11:08 +10:00
parent 4c9a851fc6
commit 973befa5d8

View File

@ -48,6 +48,10 @@ void GCS_MAVLINK::handle_device_op_read(const mavlink_message_t &msg)
retcode = 2;
goto fail;
}
if (packet.count > sizeof(data)) {
retcode = 5;
goto fail;
}
if (!dev->get_semaphore()->take(10)) {
retcode = 3;
goto fail;