Skip to content

Commit e48a131

Browse files
authored
Add null check for format in TIXML_VSCPRINTF (#1064)
1 parent 3324d04 commit e48a131

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tinyxml2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ distribution.
114114
#define TIXML_VSNPRINTF vsnprintf
115115
static inline int TIXML_VSCPRINTF( const char* format, va_list va )
116116
{
117+
if (!format) {
118+
return 0;
119+
}
117120
int len = vsnprintf( 0, 0, format, va );
118121
TIXMLASSERT( len >= 0 );
119122
return len;

0 commit comments

Comments
 (0)