Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(942)

Unified Diff: third_party/WebKit/Source/platform/WebIconSizesFuzzer.cpp

Issue 2317163002: Add fuzzer for blink::WebIconSizesParser (Closed)
Patch Set: Rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/WebIconSizesFuzzer.cpp
diff --git a/third_party/WebKit/Source/platform/WebIconSizesFuzzer.cpp b/third_party/WebKit/Source/platform/WebIconSizesFuzzer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f0ea5b21d22dc0c5d4de0c0b5b1e787fbe93bbc9
--- /dev/null
+++ b/third_party/WebKit/Source/platform/WebIconSizesFuzzer.cpp
@@ -0,0 +1,32 @@
+// 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 "platform/testing/BlinkFuzzerTestSupport.h"
+#include "public/platform/WebIconSizesParser.h"
+#include "public/platform/WebSize.h"
+#include "public/platform/WebString.h"
+
+namespace blink {
+
+// Fuzzer for blink::MHTMLParser.
+int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ WebString string = WebString::fromUTF8(
+ reinterpret_cast<const char*>(data), size);
+ WebIconSizesParser::parseIconSizes(string);
+ 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)
+{
+ blink::InitializeBlinkFuzzTest(argc, argv);
+ return 0;
+}
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698