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

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

Issue 1509163002: fuzzer for net::HttpChunkedDecoder implemented (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/http_chunked_decoder_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc b/testing/libfuzzer/fuzzers/http_chunked_decoder_fuzzer.cc
similarity index 54%
copy from testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
copy to testing/libfuzzer/fuzzers/http_chunked_decoder_fuzzer.cc
index f1d710c768e1d9f182f1b6a9d0b277bac40442cd..6b57a730fc17abdf7eafb859a0f68aa4f3ea6bda 100644
--- a/testing/libfuzzer/fuzzers/websocket_frame_parser_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/http_chunked_decoder_fuzzer.cc
@@ -4,13 +4,14 @@
#include <vector>
-#include "net/websockets/websocket_frame_parser.h"
+#include "net/http/http_chunked_decoder.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {
- net::WebSocketFrameParser parser;
- std::vector<scoped_ptr<net::WebSocketFrameChunk>> frame_chunks;
- parser.Decode(reinterpret_cast<const char*>(data), size, &frame_chunks);
+ char* data_ptr = reinterpret_cast<char*>(const_cast<unsigned char*>(data));
aizatsky 2015/12/09 18:11:07 remove this const_cast since you are copying the d
+ std::vector<char> buffer(data_ptr, data_ptr + size);
aizatsky 2015/12/08 18:23:00 everything here is non-const. Is there a chance Fi
+ net::HttpChunkedDecoder decoder;
+ decoder.FilterBuf(buffer.data(), buffer.size());
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