It is found that rgw crashes when putting a tag beyond the rule to the object, which can be solved by adding the return value judgment.
Fixes: https://tracker.ceph.com/issues/46485
Signed-off-by: zhuo li <lizhuo@chinatelecom.cn>
Signed-off-by: yupeng chen <chenyupeng@chinatelecom.cn>
for (const auto& tag : object_tags.get_tags()) {
const auto& rule_tags = rule_action.obj_tags->get_tags();
const auto& iter = rule_tags.find(tag.first);
+ if(iter == rule_tags.end())
+ continue;
if(iter->second == tag.second)
{
tag_count++;