
See docs/unsafe_buffers.md for details. Enforcement is not yet enabled, but this set of files are not in compliance with the new warnings. Bug: 390223051 Change-Id: I4e24c2141b9399f572678302c833947494098b29 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6187925 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Owners-Override: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/main@{#1412673}
26 lines
705 B
C++
26 lines
705 B
C++
// Copyright 2018 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifdef UNSAFE_BUFFERS_BUILD
|
|
// TODO(crbug.com/390223051): Remove C-library calls to fix the errors.
|
|
#pragma allow_unsafe_libc_calls
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "net/base/io_buffer.h"
|
|
#include "net/dns/dns_query.h"
|
|
|
|
// Entry point for LibFuzzer.
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
auto packet = base::MakeRefCounted<net::IOBufferWithSize>(size);
|
|
memcpy(packet->data(), data, size);
|
|
auto out = std::make_unique<net::DnsQuery>(packet);
|
|
out->Parse(size);
|
|
return 0;
|
|
}
|