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

Unified Diff: testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc

Issue 1504073002: fuzzer for WebSocketFrameParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename fuzzer and remove redundant header/dep Created 5 years 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 | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/zlib_uncompress_fuzzer.cc b/testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
similarity index 54%
copy from testing/libfuzzer/fuzzers/zlib_uncompress_fuzzer.cc
copy to testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
index 952fe24771bb35c31e4bfbb1041bccfc4a0207e8..f1d710c768e1d9f182f1b6a9d0b277bac40442cd 100644
--- a/testing/libfuzzer/fuzzers/zlib_uncompress_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
@@ -2,17 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stdint.h>
+#include <vector>
-#include "third_party/zlib/zlib.h"
+#include "net/websockets/websocket_frame_parser.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {
- uint8_t buffer[1024 * 1024] = { 0 };
- size_t buffer_length = sizeof(buffer);
- if (Z_OK != uncompress(buffer, &buffer_length, data, size)) {
- return 0;
- }
+ net::WebSocketFrameParser parser;
+ std::vector<scoped_ptr<net::WebSocketFrameChunk>> frame_chunks;
+ parser.Decode(reinterpret_cast<const char*>(data), size, &frame_chunks);
return 0;
}
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698