Files
rclone/fs
Amit Mishra eb09655949 fs: fix negative offset when a suffix Range request exceeds object size
A Range header requesting a suffix longer than the object (e.g.
"bytes=-90407" against a 5 byte object) caused RangeOption.Decode to
compute a negative offset (size - End), which serve.Object then used
directly as a slice/seek offset and panicked with "slice bounds out of
range". FixRangeOption (used by backends like OneDrive/Box that lack
native suffix-range support) had the same root cause: it produced a
RangeOption with a negative Start, which Header() silently dropped,
turning the request into the wrong byte range instead of erroring or
serving the whole object.

Per RFC 7233 section 2.1, when the suffix-length exceeds the
representation size, the entire representation should be served.
Clamp the computed offset/start to 0 in both places.

Fixes #6310

(cherry picked from commit cb41e42d04)
2026-07-08 16:40:00 +01:00
..
2025-02-28 11:31:14 +00:00
2025-02-28 11:31:14 +00:00
2025-09-15 12:45:57 +01:00
2025-10-21 18:56:06 +01:00
2025-10-21 18:56:06 +01:00
2025-02-28 11:31:14 +00:00
2023-10-23 15:43:55 +01:00
2018-08-21 10:58:59 +01:00
2025-11-03 14:44:39 +00:00
2026-04-24 17:20:18 +01:00
2026-07-08 16:37:38 +01:00