File: fuzz_bigint.cpp

package info (click to toggle)
jsoncons 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,300 kB
  • sloc: cpp: 143,266; sh: 34; makefile: 8
file content (21 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <jsoncons/utility/bigint.hpp>
#include <string>

using namespace jsoncons;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size) 
{
	std::string input(reinterpret_cast<const char*>(data), size);
	try {
        if (size < 5000) // Tests show that it will compute for very large size, but size 316737 taxes Google fuzz patience
        {
            bigint a("56654250564056135415631554531554513813");
            bigint b(input);
            bigint c = a % b;
            bigint d = b % a;
        }
	}
	catch (const std::runtime_error&) {}

	return 0;
}