Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Unified Diff: testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc

Issue 2243763002: [libFuzzer] Ensure that sqlite3_prepare_v2_fuzzer never writes to disk. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo unrelated changes. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc b/testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc
index cd7e3b4ce50eb000ce90247287831769108fb209..8f7d90a643e56d0b5cc879faef1b39e68361f9b1 100644
--- a/testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc
@@ -42,7 +42,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
sqlite3* db;
- if (SQLITE_OK != sqlite3_open(":memory:", &db))
+ int return_code = sqlite3_open_v2(
+ "db.db",
+ &db,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY, 0);
+
+
+ if (SQLITE_OK != return_code)
return 0;
// Use first byte as random selector for other parameters.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698