Commit 616f37ba authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

Move zlib_uncompress_fuzzer into third_party/zlib

Zlib's fuzzer (and other tests) should all be close to the code it is
related to.

Move zlib_uncompress_fuzzer into third_party/zlib.

BUG=779823

Change-Id: I960561b5cd83a629e9d296f56c75c7bfcec2663a
Reviewed-on: https://chromium-review.googlesource.com/744597Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512992}
parent 499dc5ab
......@@ -157,15 +157,6 @@ fuzzer_test("gfx_png_image_fuzzer") {
seed_corpuses = libpng_seed_corpuses
}
fuzzer_test("zlib_uncompress_fuzzer") {
sources = [
"zlib_uncompress_fuzzer.cc",
]
deps = [
"//third_party/zlib",
]
}
fuzzer_test("libxml_xml_read_memory_fuzzer") {
sources = [
"libxml_xml_read_memory_fuzzer.cc",
......
......@@ -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")
if (current_cpu == "arm" || current_cpu == "arm64") {
import("//build/config/arm.gni")
}
......@@ -171,6 +173,15 @@ static_library("zlib") {
deps += [ ":zlib_x86_simd" ]
}
fuzzer_test("zlib_uncompress_fuzzer") {
sources = [
"contrib/tests/fuzzers/zlib_uncompress_fuzzer.cc",
]
deps = [
":zlib",
]
}
config("minizip_warnings") {
visibility = [ ":*" ]
if (is_clang) {
......
......@@ -22,4 +22,6 @@ Local Modifications:
imported.
- The contents of the google directory are original Chromium-specific
additions.
- Plus the changes in 'patches' folder.
\ No newline at end of file
- Plus the changes in 'patches' folder.
- Code in contrib/ other than contrib/minizip was added to match zlib's
contributor layout.
cblume@chromium.org
mmoroz@chromium.org
......@@ -8,13 +8,13 @@
#include "third_party/zlib/zlib.h"
static Bytef buffer[256 * 1024] = { 0 };
static Bytef buffer[256 * 1024] = {0};
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
uLongf buffer_length = static_cast<uLongf>(sizeof(buffer));
if (Z_OK != uncompress(buffer, &buffer_length, data,
static_cast<uLong>(size))) {
if (Z_OK !=
uncompress(buffer, &buffer_length, data, static_cast<uLong>(size))) {
return 0;
}
return 0;
......
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