Also fuzz handshakes
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/* This is a fuzz test of the websocket handshake generator */
|
||||
|
||||
#define WIN32_EXPORT
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
/* We test the websocket handshake generator */
|
||||
#include "../src/libwshandshake.hpp"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
char output[28];
|
||||
if (size >= 24) {
|
||||
WebSocketHandshake::generate((char *) data, output);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@ default:
|
||||
clang++ -std=c++17 -fsanitize=address,fuzzer -O3 WebSocket.cpp -o WebSocket
|
||||
clang++ -std=c++17 -fsanitize=address,fuzzer -O3 Http.cpp -o Http
|
||||
clang++ -std=c++17 -fsanitize=address,fuzzer -O3 Extensions.cpp -o Extensions
|
||||
clang++ -std=c++17 -fsanitize=address,fuzzer -O3 Handshake.cpp -o Handshake
|
||||
|
||||
Reference in New Issue
Block a user