Commit 1b55e89c authored by Asanka Herath's avatar Asanka Herath Committed by Commit Bot

[net/http] Add fuzzer for net::HttpContentDisposition.

Bug: None
Change-Id: I37729941b4e3ca3837d259c6064d236635dd8b5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857399Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Asanka Herath <asanka@chromium.org>
Auto-Submit: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705638}
parent 7511af02
......@@ -6697,6 +6697,17 @@ fuzzer_test("net_http_chunked_decoder_fuzzer") {
]
}
fuzzer_test("net_http_content_disposition_fuzzer") {
sources = [
"http/http_content_disposition_fuzzer.cc",
]
dict = "data/fuzzer_dictionaries/net_http_content_disposition_fuzzer.dict"
deps = [
":net_fuzzer_test_support",
"//net",
]
}
fuzzer_test("net_http_proxy_client_socket_fuzzer") {
sources = [
"http/http_proxy_client_socket_fuzzer.cc",
......
# Copyright (c) 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"inline"
"attachment"
"filename"
"="
"*="
";"
"\""
"'"
" "
","
"''"
"\n"
"?"
"%"
"en"
"EUC-JP"
"iso-8859-1"
"utf-8"
"windows-1253"
"bogus_charset''foo.html'"
"\\x"
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <cstddef>
#include <cstdint>
#include <fuzzer/FuzzedDataProvider.h>
#include "net/http/http_content_disposition.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FuzzedDataProvider input{data, size};
auto charset = input.ConsumeRandomLengthString(100u);
auto header = input.ConsumeRemainingBytesAsString();
net::HttpContentDisposition content_disposition{header, charset};
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