From 2c7e3a522c1d7717fb7ec3c63b3d7c8fb2c35dcf Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Thu, 9 Jan 2025 13:57:42 +1100 Subject: [PATCH] MAVFtp: fix max payload size check --- ExtLibs/ArduPilot/Mavlink/MAVFtp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExtLibs/ArduPilot/Mavlink/MAVFtp.cs b/ExtLibs/ArduPilot/Mavlink/MAVFtp.cs index 43dd52d7c2..cbde5ce281 100644 --- a/ExtLibs/ArduPilot/Mavlink/MAVFtp.cs +++ b/ExtLibs/ArduPilot/Mavlink/MAVFtp.cs @@ -2223,7 +2223,7 @@ public bool kCmdWriteFile(Stream srcfile, string friendlyname, CancellationToken return true; } int burstmax = 8; - if(stream.Position > payload.offset + (rwSize* burstmax)) + if(stream.Position > payload.offset + (payload.data.Length * burstmax)) { stream.Position = payload.offset; Array.Resize(ref payload.data, rwSize);