From 40f91ad46aa667ccfdbbdd17ee6abe11c4afece6 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 23 Mar 2019 20:50:19 +0100 Subject: [PATCH] be more strict when parsing the configuration file --- lib/super_node.cpp | 2 +- lib/web.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/super_node.cpp b/lib/super_node.cpp index 3ee8d49d0..dc2aa3aee 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -179,7 +179,7 @@ void SuperNode::parseJson(json_t *j) idleStop = true; - ret = json_unpack_ex(j, &err, 0, "{ s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: s, s?: b }", + ret = json_unpack_ex(j, &err, JSON_STRICT, "{ s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: s, s?: b }", "http", &json_web, "logging", &json_logging, "nodes", &json_nodes, diff --git a/lib/web.cpp b/lib/web.cpp index 1dac7408a..889dc69ce 100644 --- a/lib/web.cpp +++ b/lib/web.cpp @@ -207,7 +207,7 @@ int Web::parse(json_t *cfg) const char *htd = nullptr; json_error_t err; - ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: s, s?: s, s?: i, s?: b }", + ret = json_unpack_ex(cfg, &err, JSON_STRICT, "{ s?: s, s?: s, s?: s, s?: i, s?: b }", "ssl_cert", &cert, "ssl_private_key", &pkey, "htdocs", &htd,