From: zhuo li Date: Sun, 12 Jul 2020 09:31:20 +0000 (+0800) Subject: rgwlc: fix Segmentation Fault related to tags. X-Git-Tag: wip-pdonnell-testing-20200918.022351~689^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5994ec12a7039f21b8f9e1077f2f721003de8cb6;p=ceph-ci.git rgwlc: fix Segmentation Fault related to tags. 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 Signed-off-by: yupeng chen --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 055223d499b..46e17d12f89 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -934,6 +934,8 @@ static inline bool has_all_tags(const lc_op& rule_action, 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++;