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

Unified Diff: third_party/sqlite/BUILD.gn

Issue 2497603002: Limit memory usage for sqlite3 fuzzer + move it to sqlite dir. (Closed)
Patch Set: Fix nits. Created 4 years, 1 month 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
Index: third_party/sqlite/BUILD.gn
diff --git a/third_party/sqlite/BUILD.gn b/third_party/sqlite/BUILD.gn
index 2f668b834bababd395553f4751f8d9043c4b24d7..97da41763e0e3cd073109ff37f8effc946d895f5 100644
--- a/third_party/sqlite/BUILD.gn
+++ b/third_party/sqlite/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/libfuzzer/fuzzer_test.gni")
+
declare_args() {
# Controls whether the build should uses the version of sqlite3 library
# shipped with the system (currently only supported on iOS) or the one
@@ -34,7 +36,6 @@ if (!use_system_sqlite) {
# "sqlite3" can cause conflicts with the system library.
component("chromium_sqlite3") {
visibility = [ ":*" ]
-
sources = [
"amalgamation/config.h",
"amalgamation/sqlite3.c",
@@ -129,6 +130,14 @@ if (!use_system_sqlite) {
defines += [ "_HAVE_SQLITE_CONFIG_H" ]
}
+ if (using_sanitizer) {
+ # Limit max length of data blobs and queries for fuzzing builds by 128 MB.
+ defines += [
+ "SQLITE_MAX_LENGTH=128000000",
+ "SQLITE_MAX_SQL_LENGTH=128000000",
+ ]
+ }
+
include_dirs = [ "amalgamation" ]
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -256,3 +265,13 @@ if (use_system_sqlite) {
}
}
}
+
+fuzzer_test("sqlite3_prepare_v2_fuzzer") {
+ sources = [
+ "fuzz/sqlite3_prepare_v2_fuzzer.cc",
+ ]
+ deps = [
+ ":sqlite",
+ ]
+ dict = "fuzz/sqlite3_prepare_v2_fuzzer.dict"
+}
« no previous file with comments | « testing/libfuzzer/fuzzers/sqlite3_prepare_v2_fuzzer.cc ('k') | third_party/sqlite/fuzz/sqlite3_prepare_v2_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698