Browse Source

Add null check for format in TIXML_VSCPRINTF (#1064)

sbaluja 1 week ago
parent
commit
e48a1310fe
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tinyxml2.cpp

+ 3 - 0
tinyxml2.cpp

@@ -114,6 +114,9 @@ distribution.
 	#define TIXML_VSNPRINTF	vsnprintf
 	static inline int TIXML_VSCPRINTF( const char* format, va_list va )
 	{
+	    if (!format) {
+	        return 0;
+	    }
 		int len = vsnprintf( 0, 0, format, va );
 		TIXMLASSERT( len >= 0 );
 		return len;