| Index: third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h
|
| diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoderFuzzer.cpp b/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h
|
| similarity index 63%
|
| copy from third_party/WebKit/Source/core/html/parser/TextResourceDecoderFuzzer.cpp
|
| copy to third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h
|
| index e19011319fa1df5c8461662d7fcb9db30b769cce..2b83b9fbc8e4c995437e482d68e4369b8e3d7c81 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoderFuzzer.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoderForFuzzing.h
|
| @@ -2,12 +2,13 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#ifndef TextResourceDecoderForFuzzing_h
|
| +#define TextResourceDecoderForFuzzing_h
|
| +
|
| #include "core/html/parser/TextResourceDecoder.h"
|
|
|
| #include "platform/testing/FuzzedDataProvider.h"
|
| -#include "platform/testing/TestingPlatformSupport.h"
|
| #include "wtf/text/WTFString.h"
|
| -#include <algorithm>
|
|
|
| namespace blink {
|
|
|
| @@ -35,29 +36,6 @@ private:
|
| }
|
| };
|
|
|
| -int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
| -{
|
| - FuzzedDataProvider fuzzedData(data, size);
|
| - TextResourceDecoderForFuzzing decoder(fuzzedData);
|
| - CString bytes = fuzzedData.ConsumeRemainingBytes();
|
| - decoder.decode(bytes.data(), bytes.length());
|
| - decoder.flush();
|
| - return 0;
|
| -}
|
| -
|
| } // namespace blink
|
|
|
| -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
| -{
|
| - return blink::LLVMFuzzerTestOneInput(data, size);
|
| -}
|
| -
|
| -extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
|
| -{
|
| - // Intentional leak - no need to do cleanup as explained in
|
| - // "Initialization/Cleanup" section of testing/libfuzzer/efficient_fuzzer.md
|
| - DEFINE_STATIC_LOCAL(blink::ScopedUnittestsEnvironmentSetup, testSetup, (*argc, *argv));
|
| - ALLOW_UNUSED_LOCAL(testSetup);
|
| -
|
| - return 0;
|
| -}
|
| +#endif // TextResourceDecoderForFuzzing_h
|
|
|