MCPcopy Create free account
hub / github.com/HexHive/NASS / HandleMalloc

Method HandleMalloc

fuzz/libfuzzer/FuzzerLoop.cpp:128–139  ·  view source on GitHub ↗

Crash on a single malloc that exceeds the rss limit.

Source from the content-addressed store, hash-verified

126
127// Crash on a single malloc that exceeds the rss limit.
128void Fuzzer::HandleMalloc(size_t Size) {
129 if (!Options.MallocLimitMb || (Size >> 20) < (size_t)Options.MallocLimitMb)
130 return;
131 Printf("==%d== ERROR: libFuzzer: out-of-memory (malloc(%zd))\n", GetPid(),
132 Size);
133 Printf(" To change the out-of-memory limit use -rss_limit_mb=<N>\n\n");
134 PrintStackTrace();
135 DumpCurrentUnit("oom-");
136 Printf("SUMMARY: libFuzzer: out-of-memory\n");
137 PrintFinalStats();
138 _Exit(Options.OOMExitCode); // Stop right now.
139}
140
141Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
142 const FuzzingOptions &Options)

Callers 1

MallocHookFunction · 0.80

Calls 3

PrintStackTraceFunction · 0.85
PrintfFunction · 0.70
GetPidFunction · 0.70

Tested by

no test coverage detected