1 2 #include <boost/regex.hpp> 3 LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)4extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) 5 { 6 if(Size < 2) 7 return 0; 8 std::vector<wchar_t> v(Data, Data + Size); 9 try{ 10 size_t len = (Data[1] << 8) | Data[0]; 11 if(len > Size - 2) len = Size - 2; 12 std::wstring str(&v[0] + 2, len); 13 std::wstring text(&v[0] + len, Size - len); 14 boost::wregex e(str); 15 boost::wsmatch what; 16 regex_search(text, what, e, boost::match_default|boost::match_partial); 17 } 18 catch(const std::exception&){} 19 return 0; 20 } 21 22