From: lu.shasha Date: Wed, 13 Sep 2017 01:38:51 +0000 (+0800) Subject: rgw:lc: RGWPutLC return ERR_MALFORMED_XML when missing tag in lifecycle.xml X-Git-Tag: v12.2.6~119^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9a4914b0db3d9c5f975eb1d90bf6cee10ad0dba;p=ceph.git rgw:lc: RGWPutLC return ERR_MALFORMED_XML when missing tag in lifecycle.xml Fixes: http://tracker.ceph.com/issues/21377 Signed-off-by: Shasha Lu (cherry picked from commit a08d4258228ce23c4e5fec0f556ac23cbf0ff34a) --- diff --git a/src/rgw/rgw_lc_s3.cc b/src/rgw/rgw_lc_s3.cc index b03c4c32b9ef..c5058c760d86 100644 --- a/src/rgw/rgw_lc_s3.cc +++ b/src/rgw/rgw_lc_s3.cc @@ -60,6 +60,8 @@ bool LCMPExpiration_S3::xml_end(const char *el) { bool RGWLifecycleConfiguration_S3::xml_end(const char *el) { XMLObjIter iter = find("Rule"); LCRule_S3 *rule = static_cast(iter.get_next()); + if (!rule) + return false; while (rule) { add_rule(rule); rule = static_cast(iter.get_next());