From 67a5bb0ac1a8f579ce0f3018c538b6add7087273 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 20 Aug 2014 10:01:53 +0400 Subject: [PATCH] Assert when trying to adjust _start in "needs delete" mode. --- tinyxml2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index a7b5aef..4efc768 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -150,6 +150,8 @@ char* StrPair::ParseName( char* p ) void StrPair::CollapseWhitespace() { + // Adjusting _start would cause undefined behavior on delete[] + TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 ); // Trim leading space. _start = XMLUtil::SkipWhiteSpace( _start );