Skip to content

Commit

Permalink
MAVFtp: fix max payload size check
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Jan 9, 2025
1 parent 686f77d commit 2c7e3a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ExtLibs/ArduPilot/Mavlink/MAVFtp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2c7e3a5

Please sign in to comment.