From: Abhishek Lekshmanan Date: Wed, 22 Apr 2020 09:24:34 +0000 (+0200) Subject: rgw: check for tagging element in POST Obj requests X-Git-Tag: v13.2.10~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=375d926a4f2720a29b079c216bafb884eef985c3;p=ceph.git rgw: check for tagging element in POST Obj requests Check for null element when reading the tagging field from POST obj XML Fixes: https://tracker.ceph.com/issues/44967 Signed-off-by: Abhishek Lekshmanan --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 459dd1dc715..cc4773eb3fb 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1786,6 +1786,9 @@ int RGWPostObj_ObjStore_S3::get_tags() RGWObjTagging_S3 *tagging; tagging = static_cast(parser.find_first("Tagging")); + if (!tagging) { + return -ERR_MALFORMED_XML; + } obj_tags_s3 = static_cast(tagging->find_first("TagSet")); if(!obj_tags_s3){ return -ERR_MALFORMED_XML;