]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgwlc: fix Segmentation Fault related to tags.
authorzhuo li <lizhuo@chinatelecom.cn>
Sun, 12 Jul 2020 09:31:20 +0000 (17:31 +0800)
committerzhuo li <lizhuo@chinatelecom.cn>
Sun, 12 Jul 2020 13:06:32 +0000 (21:06 +0800)
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>
src/rgw/rgw_lc.cc

index 055223d499b89c90d2be668775fd638a5e703900..46e17d12f89b68cfb767832034e496b831fb1133 100644 (file)
@@ -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++;