• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #if defined( _MSC_VER )
2 	#if !defined( _CRT_SECURE_NO_WARNINGS )
3 		#define _CRT_SECURE_NO_WARNINGS		// This test file is not intended to be secure.
4 	#endif
5 #endif
6 
7 #include "tinyxml2/tinyxml2.h"
8 #include <string>
9 #include <stddef.h>
10 #include <stdint.h>
11 
12 #if defined( _MSC_VER ) || defined (WIN32)
13 	#include <crtdbg.h>
14 	#define WIN32_LEAN_AND_MEAN
15 	#include <windows.h>
16 	_CrtMemState startMemState;
17 	_CrtMemState endMemState;
18 #else
19 	#include <sys/stat.h>
20 	#include <sys/types.h>
21 #endif
22 
23 using namespace tinyxml2;
24 using namespace std;
25 
26 // Entry point for LibFuzzer.
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)27 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
28 	std::string data_string(reinterpret_cast<const char*>(data), size);
29 	XMLDocument doc;
30 	doc.Parse( data_string.c_str() );
31 
32 	return 0;
33 }
34