Menu

#140 Address sanitizer in TiXmlBase::SkipWhiteSpace

open
nobody
3
2020-03-01
2020-03-01
No

In case of giving string for parsing XML, if there is an "unclosed" element like "<xml "="" the="" parser="" will="" search="" for="">" . While searching, the parser skipps the whitespase with function TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )</xml>

while ( *p && IsWhiteSpace( *p ) ) ++p;

in the 358 line of this fuction, the cursor reaches outsite the memory of the input string. This causes the address sanitizer.

In case of file input for pasring, everything is ok because the memory is locate 1 byte larger than the size of file.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.