MCPcopy Create free account
hub / github.com/ElementsProject/elements / write

Method write

src/test/fuzz/util.cpp:570–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570ssize_t FuzzedFileProvider::write(void* cookie, const char* buf, size_t size)
571{
572 FuzzedFileProvider* fuzzed_file = (FuzzedFileProvider*)cookie;
573 SetFuzzedErrNo(fuzzed_file->m_fuzzed_data_provider);
574 const ssize_t n = fuzzed_file->m_fuzzed_data_provider.ConsumeIntegralInRange<ssize_t>(0, size);
575 if (AdditionOverflow(fuzzed_file->m_offset, (int64_t)n)) {
576 return 0;
577 }
578 fuzzed_file->m_offset += n;
579 return n;
580}
581
582int FuzzedFileProvider::seek(void* cookie, int64_t* offset, int whence)
583{

Callers 15

ReadKeyMethod · 0.45
ReadAtCursorMethod · 0.45
ReadAtCursorMethod · 0.45
ReadKeyMethod · 0.45
DumpWalletFunction · 0.45
CreateFromDumpFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
SerializeScriptCodeMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
CheckValueMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45
operator==Function · 0.45

Calls 2

SetFuzzedErrNoFunction · 0.85
AdditionOverflowFunction · 0.85

Tested by

no test coverage detected