From e3b35992f86550420b333d0bacdea264c450fd29 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Mon, 21 Sep 2015 18:05:15 +0530 Subject: [PATCH 1/2] Add default value of stackLimit couple of places stackLimit default value is missing at two places.Adding them. --- src/lib_json/json_reader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index e0ba863..e9ed8ee 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -910,6 +910,7 @@ OurFeatures::OurFeatures() , allowSingleQuotes_(false) , failIfExtra_(false) , allowSpecialFloats_(false) + , stackLimit_(1000) { } @@ -1979,6 +1980,7 @@ void CharReaderBuilder::strictMode(Json::Value* settings) (*settings)["allowDroppedNullPlaceholders"] = false; (*settings)["allowNumericKeys"] = false; (*settings)["allowSingleQuotes"] = false; + (*settings)["stackLimit"] = 1000; (*settings)["failIfExtra"] = true; (*settings)["rejectDupKeys"] = true; (*settings)["allowSpecialFloats"] = false; From 83ea25e5e27779fbe2bf6efb1af9e5390e85085b Mon Sep 17 00:00:00 2001 From: Gaurav Date: Wed, 23 Sep 2015 09:42:26 +0530 Subject: [PATCH 2/2] Make OurFeatures ctor as default. Please review suggested changes. --- src/lib_json/json_reader.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index e9ed8ee..a2b7885 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -889,7 +889,7 @@ bool Reader::good() const { class OurFeatures { public: static OurFeatures all(); - OurFeatures(); + OurFeatures() = default; bool allowComments_; bool strictRoot_; bool allowDroppedNullPlaceholders_; @@ -904,16 +904,6 @@ public: // exact copy of Implementation of class Features // //////////////////////////////// -OurFeatures::OurFeatures() - : allowComments_(true), strictRoot_(false) - , allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) - , allowSingleQuotes_(false) - , failIfExtra_(false) - , allowSpecialFloats_(false) - , stackLimit_(1000) -{ -} - OurFeatures OurFeatures::all() { return OurFeatures(); } // Implementation of class Reader