From: Matt Benjamin Date: Mon, 17 Feb 2025 21:30:26 +0000 (-0500) Subject: rgw: handle bad/unknown checksum case in cksum::Factory X-Git-Tag: v20.3.0~225^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=07afdc10d3a8228a8d5849d4b8406002b868a4fd;p=ceph.git rgw: handle bad/unknown checksum case in cksum::Factory Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_cksum_pipe.cc b/src/rgw/rgw_cksum_pipe.cc index 0bec8d341af07..32b93755f5d8f 100644 --- a/src/rgw/rgw_cksum_pipe.cc +++ b/src/rgw/rgw_cksum_pipe.cc @@ -43,9 +43,14 @@ namespace rgw::putobj { if (algo_header.first) { if (algo_header.second) { auto cksum_type = cksum::parse_cksum_type(algo_header.second); - return - std::make_unique( - next, cksum_type, std::move(algo_header)); + /* unknown checksum type in header */ + if (cksum_type != rgw::cksum::Type::none) { + return + std::make_unique( + next, cksum_type, std::move(algo_header)); + } else { + return std::unique_ptr(); + } } /* malformed checksum algorithm header(s) */ throw rgw::io::Exception(EINVAL, std::system_category());