From f604f11adae849d7b5482bec3deaf4275befa968 Mon Sep 17 00:00:00 2001 From: Tristan Penman Date: Thu, 17 Apr 2014 23:06:48 +0000 Subject: [PATCH] Fix memory corruption issue in schema parser. --- include/valijson/schema_parser.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/valijson/schema_parser.hpp b/include/valijson/schema_parser.hpp index bd86226..94da04d 100644 --- a/include/valijson/schema_parser.hpp +++ b/include/valijson/schema_parser.hpp @@ -88,8 +88,10 @@ public: } if ((itr = object.find("allOf")) != object.end()) { - const AdapterType &childNode = resolveReference(deref, schema, itr->second); - schema.addConstraint(makeAllOfConstraint(childNode, deref)); + const AdapterType originalChildNode = itr->second; + const AdapterType &actualChildNode = resolveReference(deref, schema, + originalChildNode); + schema.addConstraint(makeAllOfConstraint(actualChildNode, deref)); } if ((itr = object.find("anyOf")) != object.end()) {