summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-09-25 13:04:48 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-09-27 16:44:19 -0700
commit793d9d27b2398de80931d81216d22eda3b63a096 (patch)
treed5590678755978c2a93b594d03d467e7ec83b349
parentc8cae87e9e08468cc86145e0fd60c05d12826239 (diff)
downloadceph-793d9d27b2398de80931d81216d22eda3b63a096.tar.gz
ceph_json: use different string constructor for parser buffer
Fixes: #6397 Previous implementation did not user the constructor with the length param. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/common/ceph_json.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc
index 84355575c6c..a48e0636fcf 100644
--- a/src/common/ceph_json.cc
+++ b/src/common/ceph_json.cc
@@ -222,9 +222,7 @@ bool JSONParser::parse(const char *buf_, int len)
return false;
}
- string json_string = buf_;
- // make a substring to len
- json_string = json_string.substr(0, len);
+ string json_string(buf_, len);
success = read(json_string, data);
if (success)
handle_value(data);