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
..
2026-07-08 16:40:00 +01:00
2026-02-18 12:11:52 +00:00
2025-07-08 12:08:14 +02:00
2025-02-28 11:31:14 +00:00
2025-02-28 11:31:14 +00:00
2026-07-08 16:40:00 +01:00
2025-09-15 12:45:57 +01:00
2024-04-18 16:53:55 +02:00
2026-07-08 16:40:00 +01:00
2025-10-21 18:56:06 +01:00
2026-04-15 18:22:05 +01:00
2025-07-23 15:09:51 +01:00
2026-01-18 20:48:33 +01:00
2026-03-12 10:00:56 +00:00
2026-06-03 17:51:47 +01:00
2025-10-21 18:56:06 +01:00
2026-02-18 12:11:52 +00:00
2025-11-17 16:52:30 +00:00
2026-07-08 16:40:00 +01:00
2026-06-05 15:22:06 +01:00
2026-04-19 13:31:27 +01:00
2026-02-18 12:11:52 +00:00
2021-05-14 14:07:44 +01:00
2025-02-28 11:31:14 +00:00
2024-07-15 11:09:54 +01:00
2023-10-23 15:43:55 +01:00
2024-07-17 11:04:01 +01:00
2026-01-27 11:44:47 +00:00
2018-08-21 10:58:59 +01:00
2019-02-07 11:57:26 +00:00
2026-06-05 15:22:06 +01:00
2026-06-05 15:22:06 +01:00
2026-07-08 16:40:00 +01:00
2024-07-15 11:09:54 +01:00
2024-08-15 22:08:34 +01:00
2024-07-15 11:09:54 +01:00
2023-10-03 15:14:24 +01:00
2024-04-18 16:53:55 +02:00
2024-04-18 16:53:55 +02:00
2018-01-15 17:51:14 +00:00
2024-03-07 11:09:07 +00:00
2024-02-27 10:56:19 +00:00
2019-07-28 18:47:38 +01:00
2019-06-09 15:57:05 +01:00
2024-07-15 11:09:54 +01:00
2026-04-15 18:22:05 +01:00
2024-07-15 11:09:54 +01:00
2023-10-03 15:14:24 +01:00
2025-04-08 15:12:53 +01:00
2023-04-28 14:31:05 +01:00
2020-06-30 12:01:36 +01:00
2025-11-03 14:44:39 +00:00
2026-04-24 17:20:18 +01:00
2024-07-15 11:09:54 +01:00
2025-11-12 12:22:04 +00:00
2024-04-18 16:53:55 +02:00
2023-11-18 17:49:35 +00:00
2024-02-27 10:56:19 +00:00
2025-09-15 12:45:57 +01:00
2022-05-12 20:27:13 +01:00
2024-09-06 17:04:18 +01:00
2026-06-05 15:22:06 +01:00
2025-07-23 15:09:51 +01:00
2026-06-05 15:22:06 +01:00
2026-07-08 16:40:00 +01:00
2026-07-08 16:40:00 +01:00
2023-05-14 11:22:57 +01:00
2023-05-14 11:22:57 +01:00
2022-11-21 08:02:09 +00:00
2023-05-09 16:28:10 +01:00
2025-11-03 14:44:39 +00:00
2025-03-25 15:49:27 +00:00
2024-07-15 11:09:54 +01:00
2025-10-29 16:48:34 +00:00
2024-07-15 11:09:54 +01:00
2023-05-04 15:04:11 +01:00
2026-07-08 16:40:00 +01:00
2026-07-08 16:40:00 +01:00
2024-07-15 11:09:54 +01:00
2024-08-15 22:08:34 +01:00
2023-10-03 15:14:24 +01:00
2023-10-03 15:14:24 +01:00
2024-07-15 11:09:54 +01:00
2023-03-27 16:17:49 +01:00
2026-01-18 20:48:33 +01:00
2022-05-17 12:10:01 +01:00
2026-02-18 11:33:48 +00:00
2022-05-17 12:10:01 +01:00
2026-07-08 16:37:38 +01:00