From e4bcdd403456428657c1ca1f3a03f3fcc4f00786 Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Tue, 28 Apr 2020 16:59:33 -0400 Subject: [PATCH] cwObject.cpp : Check for unexpected NULL node in objectFromString(). --- cwObject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cwObject.cpp b/cwObject.cpp index fd82736..da4fe5e 100644 --- a/cwObject.cpp +++ b/cwObject.cpp @@ -787,6 +787,12 @@ cw::rc_t cw::objectFromString( const char* s, object_t*& objRef ) _objSyntaxError(lexH,"Unknown token type (%i) in text.", int(lexId) ); } + if( cnp == nullptr ) + { + rc = _objSyntaxError( lexH, "Node parse failed." ); + goto errLabel; + } + // if this is a pair node and it now has both values // then make the parent 'object' the current node if( cnp->is_pair() && cnp->child_count()==2 )