From 793d9d27b2398de80931d81216d22eda3b63a096 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 25 Sep 2013 13:04:48 -0700 Subject: [PATCH] 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc index 84355575c6c99..a48e0636fcfcf 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); -- 2.39.5