소스 검색

Merge pull request #197 from Dmitry-Me/dontAdjustStartWhenNeedsDelete

Assert when trying to adjust _start in "needs delete" mode.
Lee Thomason 11 년 전
부모
커밋
dc50a31758
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      tinyxml2.cpp

+ 2 - 0
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 );