From 25e15b76b4213b427ef11056db979a42039d3f7b Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 25 Sep 2013 13:04:48 -0700 Subject: 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 --- src/common/ceph_json.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc index 84355575c6c..609d134ce5a 100644 --- a/src/common/ceph_json.cc +++ b/src/common/ceph_json.cc @@ -222,7 +222,7 @@ bool JSONParser::parse(const char *buf_, int len) return false; } - string json_string = buf_; + string json_string(buf_, len); // make a substring to len json_string = json_string.substr(0, len); success = read(json_string, data); -- cgit v1.2.1