Also fuzz handshakes

This commit is contained in:
Alex Hultman
2019-03-13 17:21:05 +01:00
parent 9fb3580785
commit ea0d6a0b3d
2 changed files with 21 additions and 0 deletions
+20
View File
@@ -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;
}
+1
View File
@@ -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