Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
3f7c7f19
提交
3f7c7f19
authored
12月 14, 2018
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fuzzer: paying with fuzzer.cpp
上级
91b3fa4c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
5 行删除
+30
-5
Building.md
doc/Building.md
+1
-1
fuzzer.cpp
worker/fuzzer/fuzzer.cpp
+29
-4
没有找到文件。
doc/Building.md
浏览文件 @
3f7c7f19
...
@@ -91,7 +91,7 @@ Some environment variables than `fuzzer-run` are supported. However:
...
@@ -91,7 +91,7 @@ Some environment variables than `fuzzer-run` are supported. However:
Example:
Example:
```
bash
```
bash
$ FUZZER_
CORPUS_DIRS
=
"fuzzer/corpora/rt
p-corpus"
make fuzzer-docker-run
$ FUZZER_
OPTIONS
=
"-max_len=1800"
FUZZER_CORPUS_DIRS
=
"fuzzer/corpora/stun-corpus fuzzer/corpora/rtp-corpus fuzzer/corpora/rtc
p-corpus"
make fuzzer-docker-run
```
```
...
...
worker/fuzzer/fuzzer.cpp
浏览文件 @
3f7c7f19
#include "DepLibUV.hpp"
#include "DepLibUV.hpp"
#include "DepOpenSSL.hpp"
#include "DepOpenSSL.hpp"
#include "Utils.hpp"
#include "Utils.hpp"
#include "RTC/StunMessage.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RTCP/Packet.hpp"
#include <stdint.h>
#include <stdint.h>
#include <stddef.h>
#include <stddef.h>
#include <iostream>
#include <iostream>
using
namespace
RTC
;
int
init
()
int
init
()
{
{
// Initialize static stuff.
// Initialize static stuff.
...
@@ -22,13 +26,34 @@ void fuzz(const uint8_t* data, size_t len)
...
@@ -22,13 +26,34 @@ void fuzz(const uint8_t* data, size_t len)
// If a RTP packet clone it, read properties, set stuff, etc.
// If a RTP packet clone it, read properties, set stuff, etc.
// If RTCP the same.
// If RTCP the same.
// If ICE too.
// If ICE too.
//
// NOTE: This code could be split in different files under a new src/ folder
// with its corresponding new include/ folder.
// Check if it's STUN.
if
(
StunMessage
::
IsStun
(
data
,
len
))
{
StunMessage
*
msg
=
StunMessage
::
Parse
(
data
,
len
);
RTC
::
RtpPacket
::
IsRtp
(
data
,
len
);
if
(
msg
)
delete
msg
;
}
// Check if it's RTCP.
else
if
(
RTCP
::
Packet
::
IsRtcp
(
data
,
len
))
{
RTCP
::
Packet
*
packet
=
RTCP
::
Packet
::
Parse
(
data
,
len
);
RTC
::
RtpPacket
*
packet
=
RTC
::
RtpPacket
::
Parse
(
data
,
len
);
if
(
packet
)
delete
packet
;
}
// Check if it's RTP.
else
if
(
RtpPacket
::
IsRtp
(
data
,
len
))
{
RtpPacket
*
packet
=
RtpPacket
::
Parse
(
data
,
len
);
if
(
packet
)
if
(
packet
)
delete
packet
;
delete
packet
;
}
}
}
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
len
)
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
len
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论