Commit 120545cc authored by Kevin Bailey's avatar Kevin Bailey Committed by Commit Bot

[omnibox] Limit search suggest parser fuzzer input size

There were some reported oom's, so curb size to something reasonable.
This CL only affects the fuzzer.

Bug: 1018506, 1018522
Change-Id: I051da49d510fb108dea95925104c839d11ef5aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1883871Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Kevin Bailey <krb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709902}
parent 655dbc66
...@@ -23,6 +23,10 @@ struct IcuEnvironment { ...@@ -23,6 +23,10 @@ struct IcuEnvironment {
IcuEnvironment icu_env; IcuEnvironment icu_env;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// This is an arbitrary size, and arguably even small for a JSON input,
// but we have to cut it off somewhere.
if (size > 4096)
return 0;
std::unique_ptr<std::string> response_body = std::unique_ptr<std::string> response_body =
std::make_unique<std::string>(reinterpret_cast<const char*>(data), size); std::make_unique<std::string>(reinterpret_cast<const char*>(data), size);
std::unique_ptr<base::Value> value( std::unique_ptr<base::Value> value(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment