From: Jesse F. Williamson Date: Tue, 18 Mar 2025 19:35:50 +0000 (-0700) Subject: This appears to fix RGW auth... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fee352905f70219ccb035b1f0020e5215192e10;p=ceph.git This appears to fix RGW auth... ...but sure is a bit mysterious to me. Signed-off-by: Jesse F. Williamson --- diff --git a/src/rgw/rgw_policy_s3.cc b/src/rgw/rgw_policy_s3.cc index 7b8ad0452cb..d734249ed2c 100644 --- a/src/rgw/rgw_policy_s3.cc +++ b/src/rgw/rgw_policy_s3.cc @@ -248,9 +248,11 @@ int RGWPolicy::from_json(bufferlist& bl, string& err_msg) { JSONParser parser; - if (!parser.parse(bl.c_str(), bl.length())) { - err_msg = "Malformed JSON"; - dout(0) << "malformed json" << dendl; + // Without subtracting 1, we wind up sending bad data into the + // parser: + if (!parser.parse(bl.c_str(), bl.length() - 1)) { + err_msg = "Malformed JSON (RGWPolicy)"; + dout(0) << "malformed json (RGWPolicy)" << dendl; return -EINVAL; }