| Index: third_party/WebKit/Source/core/css/StyleSheetContentsFuzzer.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/StyleSheetContentsFuzzer.cpp b/third_party/WebKit/Source/core/css/StyleSheetContentsFuzzer.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..df91a60d54e6646789ceadf69e95136f57d40063
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/css/StyleSheetContentsFuzzer.cpp
|
| @@ -0,0 +1,22 @@
|
| +// Copyright 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.
|
| +
|
| +#include "core/css/StyleSheetContents.h"
|
| +
|
| +#include "platform/testing/BlinkFuzzerTestSupport.h"
|
| +#include "wtf/text/WTFString.h"
|
| +
|
| +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
| +{
|
| + blink::CSSParserContext context(blink::HTMLStandardMode, nullptr);
|
| + blink::StyleSheetContents* styleSheet = blink::StyleSheetContents::create(context);
|
| + styleSheet->parseString(String::fromUTF8WithLatin1Fallback(reinterpret_cast<const char*>(data), size));
|
| + return 0;
|
| +}
|
| +
|
| +extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
|
| +{
|
| + blink::InitializeBlinkFuzzTest(argc, argv);
|
| + return 0;
|
| +}
|
|
|