Skip to content

Commit

Permalink
rgw: check for tagging element in POST Obj requests
Browse files Browse the repository at this point in the history
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 <abhishek@suse.com>
  • Loading branch information
theanalyst committed Apr 22, 2020
1 parent f211c00 commit 375d926
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rgw/rgw_rest_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,9 @@ int RGWPostObj_ObjStore_S3::get_tags()
RGWObjTagging_S3 *tagging;

tagging = static_cast<RGWObjTagging_S3 *>(parser.find_first("Tagging"));
if (!tagging) {
return -ERR_MALFORMED_XML;
}
obj_tags_s3 = static_cast<RGWObjTagSet_S3 *>(tagging->find_first("TagSet"));
if(!obj_tags_s3){
return -ERR_MALFORMED_XML;
Expand Down

0 comments on commit 375d926

Please sign in to comment.