Chromium Code Reviews| Index: third_party/sqlite/BUILD.gn |
| diff --git a/third_party/sqlite/BUILD.gn b/third_party/sqlite/BUILD.gn |
| index 2f668b834bababd395553f4751f8d9043c4b24d7..8d3f9deb1287f6010ff9223da5bd5c386bb3cd22 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 (use_libfuzzer) { |
|
mmoroz
2016/11/11 15:24:05
That's wrong, we have another flag which should wo
Scott Hess - ex-Googler
2016/11/11 15:43:09
WRT my LGTM, consider it sticky WRT the other code
|
| + # Limit max length of data blobs and queries by 128M for fuzzing build. |
| + 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 = "//testing/libfuzzer/fuzzers/dicts/generated/sqlite3_prepare_v2_fuzzer.dict" |
| +} |