From ede9eedf8a07ec022c705e35d1d1860cf22f565d Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 25 Mar 2019 15:24:15 +0100 Subject: [PATCH] rgw_crypt: take care of start & end boundaries when parsing range As http range header is inclusive of start and end ranges, this otherwise breaks at ranges close to multipart boundaries Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 9c92b56d77932283ccc0336645dc3b76bd0fffa2) --- src/rgw/rgw_crypt.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 5cdeff86c4a57..079f8cd312668 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -567,13 +567,13 @@ int RGWGetObj_BlockDecrypt::fixup_range(off_t& bl_ofs, off_t& bl_end) { off_t in_end = bl_end; size_t i = 0; - while (i (off_t)parts_len[i])) { + while (i= (off_t)parts_len[i])) { in_ofs -= parts_len[i]; i++; } //in_ofs is inside block i size_t j = 0; - while (j (off_t)parts_len[j])) { + while (j= (off_t)parts_len[j])) { in_end -= parts_len[j]; j++; } -- 2.39.5