Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
de8f15b9
提交
de8f15b9
authored
12月 15, 2018
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stun::Parse(): Fix wrong memory access (fix #244)
上级
d052fd64
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
75 行增加
和
1 行删除
+75
-1
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+75
-1
没有找到文件。
worker/src/RTC/StunMessage.cpp
浏览文件 @
de8f15b9
...
@@ -126,7 +126,7 @@ namespace RTC
...
@@ -126,7 +126,7 @@ namespace RTC
{
{
MS_WARN_TAG
(
MS_WARN_TAG
(
ice
,
ice
,
"attribute after MESSAGE
_
INTEGRITY other than FINGERPRINT is not allowed, "
"attribute after MESSAGE
-
INTEGRITY other than FINGERPRINT is not allowed, "
"message discarded"
);
"message discarded"
);
delete
msg
;
delete
msg
;
...
@@ -144,30 +144,79 @@ namespace RTC
...
@@ -144,30 +144,79 @@ namespace RTC
break
;
break
;
}
}
case
Attribute
:
:
PRIORITY
:
case
Attribute
:
:
PRIORITY
:
{
{
// Ensure attribute length is 4 bytes.
if
(
attrLength
!=
4
)
{
MS_WARN_TAG
(
ice
,
"attribute PRIORITY must be 4 bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
msg
->
SetPriority
(
Utils
::
Byte
::
Get4Bytes
(
attrValuePos
,
0
));
msg
->
SetPriority
(
Utils
::
Byte
::
Get4Bytes
(
attrValuePos
,
0
));
break
;
break
;
}
}
case
Attribute
:
:
ICE_CONTROLLING
:
case
Attribute
:
:
ICE_CONTROLLING
:
{
{
// Ensure attribute length is 8 bytes.
if
(
attrLength
!=
8
)
{
MS_WARN_TAG
(
ice
,
"attribute ICE-CONTROLLING must be 8 bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
msg
->
SetIceControlling
(
Utils
::
Byte
::
Get8Bytes
(
attrValuePos
,
0
));
msg
->
SetIceControlling
(
Utils
::
Byte
::
Get8Bytes
(
attrValuePos
,
0
));
break
;
break
;
}
}
case
Attribute
:
:
ICE_CONTROLLED
:
case
Attribute
:
:
ICE_CONTROLLED
:
{
{
// Ensure attribute length is 8 bytes.
if
(
attrLength
!=
8
)
{
MS_WARN_TAG
(
ice
,
"attribute ICE-CONTROLLED must be 8 bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
msg
->
SetIceControlled
(
Utils
::
Byte
::
Get8Bytes
(
attrValuePos
,
0
));
msg
->
SetIceControlled
(
Utils
::
Byte
::
Get8Bytes
(
attrValuePos
,
0
));
break
;
break
;
}
}
case
Attribute
:
:
USE_CANDIDATE
:
case
Attribute
:
:
USE_CANDIDATE
:
{
{
// Ensure attribute length is 0 bytes.
if
(
attrLength
!=
0
)
{
MS_WARN_TAG
(
ice
,
"attribute USE-CANDIDATE must be 0 bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
msg
->
SetUseCandidate
();
msg
->
SetUseCandidate
();
break
;
break
;
}
}
case
Attribute
:
:
MESSAGE_INTEGRITY
:
case
Attribute
:
:
MESSAGE_INTEGRITY
:
{
{
hasMessageIntegrity
=
true
;
hasMessageIntegrity
=
true
;
...
@@ -175,8 +224,20 @@ namespace RTC
...
@@ -175,8 +224,20 @@ namespace RTC
break
;
break
;
}
}
case
Attribute
:
:
FINGERPRINT
:
case
Attribute
:
:
FINGERPRINT
:
{
{
// Ensure attribute length is 4 bytes.
if
(
attrLength
!=
4
)
{
MS_WARN_TAG
(
ice
,
"attribute FINGERPRINT must be 4 bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
hasFingerprint
=
true
;
hasFingerprint
=
true
;
fingerprintAttrPos
=
pos
;
fingerprintAttrPos
=
pos
;
fingerprint
=
Utils
::
Byte
::
Get4Bytes
(
attrValuePos
,
0
);
fingerprint
=
Utils
::
Byte
::
Get4Bytes
(
attrValuePos
,
0
);
...
@@ -184,8 +245,20 @@ namespace RTC
...
@@ -184,8 +245,20 @@ namespace RTC
break
;
break
;
}
}
case
Attribute
:
:
ERROR_CODE
:
case
Attribute
:
:
ERROR_CODE
:
{
{
// Ensure attribute length >= 4bytes.
if
(
attrLength
<
4
)
{
MS_WARN_TAG
(
ice
,
"attribute ERROR-CODE must be >= 4bytes length, message discarded"
);
delete
msg
;
return
nullptr
;
}
uint8_t
errorClass
=
Utils
::
Byte
::
Get1Byte
(
attrValuePos
,
2
);
uint8_t
errorClass
=
Utils
::
Byte
::
Get1Byte
(
attrValuePos
,
2
);
uint8_t
errorNumber
=
Utils
::
Byte
::
Get1Byte
(
attrValuePos
,
3
);
uint8_t
errorNumber
=
Utils
::
Byte
::
Get1Byte
(
attrValuePos
,
3
);
auto
errorCode
=
static_cast
<
uint16_t
>
(
errorClass
*
100
+
errorNumber
);
auto
errorCode
=
static_cast
<
uint16_t
>
(
errorClass
*
100
+
errorNumber
);
...
@@ -194,6 +267,7 @@ namespace RTC
...
@@ -194,6 +267,7 @@ namespace RTC
break
;
break
;
}
}
default
:
;
default
:
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论