提交 597029a4 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

fuzzer: cosmetic

上级 5a520284
......@@ -59,10 +59,12 @@ It's recommended to pass the following fuzzer options:
Also, there are corpus folders in `fuzzer/corpora`. If used, it's recommended to use `fuzzer/new-corpus` as first directory, so fuzzer generated test inputs are saved in there.
For memory leak detection, set `LSAN_OPTIONS=verbosity=1:log_threads=1` environment variable.
Example:
```bash
$ ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus fuzzer/corpora/rtp-corpus fuzzer/corpora/rtcp-corpus fuzzer/corpora/stun-corpus
$ LSAN_OPTIONS=verbosity=1:log_threads=1 ./out/Release/mediasoup-worker-fuzzer -artifact_prefix=fuzzer/reports/ -max_len=1800 -workers=1 fuzzer/new-corpus fuzzer/corpora/rtcp-corpus
```
......
......@@ -6,7 +6,7 @@
#include "RTC/RTCP/Packet.hpp"
#include <stdint.h>
#include <stddef.h>
#include <iostream>
#include <iostream> // TODO: Remove.
using namespace RTC;
......@@ -24,8 +24,7 @@ void fuzz(const uint8_t* data, size_t len)
{
// TODO: Test everything here.
// If a RTP packet clone it, read properties, set stuff, etc.
// If RTCP the same.
// If ICE too.
// If RTCP or STUN the same, etc.
//
// NOTE: This code could be split in different files under a new src/ folder
// with its corresponding new include/ folder.
......@@ -58,18 +57,10 @@ void fuzz(const uint8_t* data, size_t len)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t len)
{
// Trick to initialize our stuff just once.
static int unused = init();
fuzz(data, len);
return 0;
}
#ifdef MS_FUZZER_FAKE
int main(int argc, char* argv[])
{
std::cout << "OK, it compiles. Now go to Linux and run `make fuzzer-run." << std::endl;
return 0;
}
#endif
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论