]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/de_fuzz/narrow.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / regex / test / de_fuzz / narrow.cpp
1
2 #include <boost/regex.hpp>
3
4 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
5 {
6 if(Size < 2)
7 return 0;
8 try{
9 size_t len = (Data[1] << 8) | Data[0];
10 if(len > Size - 2) len = Size - 2;
11 std::string str((char*)(Data + 2), len);
12 std::string text((char*)(Data + len), Size - len);
13 boost::regex e(str);
14 boost::smatch what;
15 regex_search(text, what, e, boost::match_default|boost::match_partial);
16 }
17 catch(const std::exception&){}
18 return 0;
19 }
20