...but sure is a bit mysterious to me.
Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
{
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;
}