From: Yehuda Sadeh Date: Wed, 25 Sep 2013 20:04:48 +0000 (-0700) Subject: ceph_json: use different string constructor for parser buffer X-Git-Tag: mark-v0.70-wip~12^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=793d9d27b2398de80931d81216d22eda3b63a096;p=ceph.git 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 --- diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc index 84355575c6c9..a48e0636fcfc 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);