diff options
-rw-r--r-- | tools/fuzzer/Android.bp | 7 | ||||
-rw-r--r-- | tools/fuzzer/libart_verify_dex_fuzzer.cc | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/fuzzer/Android.bp b/tools/fuzzer/Android.bp index 8ade397a85..556460e230 100644 --- a/tools/fuzzer/Android.bp +++ b/tools/fuzzer/Android.bp @@ -26,13 +26,18 @@ package { cc_fuzz { name: "libart_verify_dex_fuzzer", srcs: ["libart_verify_dex_fuzzer.cc"], - defaults: ["libart_static_defaults"], + + // Run in debug mode for the DCHECKs. + defaults: ["libartd_static_defaults"], + // Build and run on x86 only for now. host_supported: true, device_supported: false, + corpus: ["corpus/*"], dictionary: "dex.dict", fuzz_config: { + triage_assignee: "art-performance-team@google.com", cc: ["solanes@google.com", "art-bugs@google.com"], componentid: 86431, acknowledgement: [ diff --git a/tools/fuzzer/libart_verify_dex_fuzzer.cc b/tools/fuzzer/libart_verify_dex_fuzzer.cc index 39ebe0ea06..9f2b935695 100644 --- a/tools/fuzzer/libart_verify_dex_fuzzer.cc +++ b/tools/fuzzer/libart_verify_dex_fuzzer.cc @@ -21,6 +21,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Initialize environment. art::MemMap::Init(); + // Skip compact DEX. + // TODO(dsrbecky): Remove after removing compact DEX. + const char* dex_string = "cdex"; + if (strncmp(dex_string, (const char*)data, strlen(dex_string)) == 0) { + // A -1 indicates we don't want this DEX added to the corpus. + return -1; + } + // Open and verify the DEX file. Do not verify the checksum as we only care about the DEX file // contents, and know that the checksum would probably be erroneous. std::string error_msg; |