// Global variable to count how many DEX files passed DEX file verification and they were // registered, since these are the cases for which we would be running the GC. In case of // scheduling multiple fuzzer jobs, using the ‘-jobs’ flag, this is not shared among the threads. int skipped_gc_iterations = 0; // Global variable to call the GC once every maximum number of iterations. // TODO: These values were obtained from local experimenting. They can be changed after // further investigation. static constexpr int kMaxSkipGCIterations = 3000;
extern"C"int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Note that we ignore the resulting DEX file from `VerifyDexFile` since we want to copy `data` to // manage it ourselves. if (VerifyDexFile(data, size, "fuzz.dex") == nullptr) { // DEX file couldn't be verified, don't save it in the corpus. return -1;
}
// Copy data to keep it alive. Use unique_ptr so that we don't leak.
data_to_delete.emplace_back(new uint8_t[size]);
uint8_t* new_data = data_to_delete.back().get();
memcpy(new_data, data, size);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.