]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add return value checking to avoid possible subsequent `parse` exception
authorYan Jun <yan.jun8@zte.com.cn>
Mon, 11 Jul 2016 02:07:13 +0000 (10:07 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Mon, 11 Jul 2016 11:52:45 +0000 (19:52 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/rgw/rgw_rest_s3.cc

index 23267199c78bdf0b0da6f61cd8cffc4121b7a65d..d693d2716c4c800c110fcbb8f400618b623e20de 100644 (file)
@@ -785,7 +785,10 @@ int RGWSetBucketWebsite_ObjStore_S3::get_params()
   }
 
   RGWXMLDecoder::XMLParser parser;
-  parser.init();
+  if (!parser.init()) {
+    ldout(s->cct, 0) << "ERROR: failed to initialize parser" << dendl;
+    return -EIO;
+  }
 
   if (!parser.parse(data, len, 1)) {
     string str(data, len);