]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:lc: RGWPutLC return ERR_MALFORMED_XML when missing <Rule> tag in lifecycle.xml 19884/head
authorlu.shasha <lu.shasha@eisoo.com>
Wed, 13 Sep 2017 01:38:51 +0000 (09:38 +0800)
committerPrashant D <pdhange@redhat.com>
Tue, 9 Jan 2018 23:37:43 +0000 (18:37 -0500)
Fixes: http://tracker.ceph.com/issues/21377
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
(cherry picked from commit a08d4258228ce23c4e5fec0f556ac23cbf0ff34a)

src/rgw/rgw_lc_s3.cc

index b03c4c32b9efa5d9b19397de49066a023a156750..c5058c760d86343f14c54904365294588211bf2d 100644 (file)
@@ -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<LCRule_S3 *>(iter.get_next());
+  if (!rule)
+    return false;
   while (rule) {
     add_rule(rule);
     rule = static_cast<LCRule_S3 *>(iter.get_next());