From 7744cd74c0bc5050d938669a1ecd68976ad14563 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 15 Jul 2026 09:37:33 +1200 Subject: [PATCH] FTP: Fix off-by-one in data byte index range The FILE_TRANSFER_PROTOCOL payload is 251 bytes (indices 0-250), so the data[] field spans indices 12 to 250, not 12 to 251. Fixes #728 --- en/services/ftp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/services/ftp.md b/en/services/ftp.md index b1eae5ae2..a6ad0ab82 100644 --- a/en/services/ftp.md +++ b/en/services/ftp.md @@ -65,7 +65,7 @@ Below is the over-the-wire format for the payload part of the [FILE_TRANSFER_PRO | 6 | `uint8_t burst_complete` | Burst complete | 0, 1 | Code to indicate if a burst is complete. 1: set of burst packets complete, 0: More burst packets coming.
- Only used if `req_opcode` is [BurstReadFile](#BurstReadFile). | | 7 | `uint8_t padding` | Padding | | 32 bit alignment padding. | | 8 to 11 | `uint32_t offset` | Content offset | | Offsets into data to be sent for [ListDirectory](#ListDirectory) and [ReadFile](#ReadFile) commands. | -| 12 to (max) 251 | `uint8_t data[]` | Data | | Command/response data. Varies by [OpCode](#opcodes). This contains the `path` for operations that act on a file or directory. For an ACK for a read or write this is the requested information. For an ACK for a `OpenFileRO` operation this is the size of the file that was opened. For a NAK the first byte is the [error code](#error_codes) and the (optional) second byte may be an error number. | +| 12 to (max) 250 | `uint8_t data[]` | Data | | Command/response data. Varies by [OpCode](#opcodes). This contains the `path` for operations that act on a file or directory. For an ACK for a read or write this is the requested information. For an ACK for a `OpenFileRO` operation this is the size of the file that was opened. For a NAK the first byte is the [error code](#error_codes) and the (optional) second byte may be an error number. | ## OpCodes/Command {#opcodes}