Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
37eab27b
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
37eab27b
编写于
6月 07, 2018
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add fuzzing of gsub closure to hb-subset-fuzzer.
上级
feb23892
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
7 deletion
+20
-7
test/fuzzing/hb-subset-fuzzer.cc
test/fuzzing/hb-subset-fuzzer.cc
+20
-7
未找到文件。
test/fuzzing/hb-subset-fuzzer.cc
浏览文件 @
37eab27b
...
...
@@ -6,16 +6,17 @@
#include "hb-subset.h"
void
trySubset
(
hb_face_t
*
face
,
const
hb_codepoint_t
text
[],
int
text_length
,
bool
drop_hints
)
bool
drop_hints
,
bool
drop_ot_layout
)
{
hb_subset_profile_t
*
profile
=
hb_subset_profile_create
();
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
*
hb_subset_input_drop_hints
(
input
)
=
drop_hints
;
*
hb_subset_input_drop_hints
(
input
)
=
drop_hints
;
*
hb_subset_input_drop_ot_layout
(
input
)
=
drop_ot_layout
;
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
for
(
int
i
=
0
;
i
<
text_length
;
i
++
)
...
...
@@ -30,6 +31,20 @@ void trySubset (hb_face_t *face,
hb_subset_profile_destroy
(
profile
);
}
void
trySubset
(
hb_face_t
*
face
,
const
hb_codepoint_t
text
[],
int
text_length
)
{
for
(
unsigned
int
drop_hints
=
0
;
drop_hints
<
2
;
drop_hints
++
)
{
for
(
unsigned
int
drop_ot_layout
=
0
;
drop_ot_layout
<
2
;
drop_ot_layout
++
)
{
trySubset
(
face
,
text
,
text_length
,
(
bool
)
drop_hints
,
(
bool
)
drop_ot_layout
);
}
}
}
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
hb_blob_t
*
blob
=
hb_blob_create
((
const
char
*
)
data
,
size
,
...
...
@@ -42,8 +57,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
'3'
,
'@'
,
'_'
,
'%'
,
'&'
,
')'
,
'*'
,
'$'
,
'!'
};
trySubset
(
face
,
text
,
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
),
true
);
trySubset
(
face
,
text
,
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
),
false
);
trySubset
(
face
,
text
,
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
));
hb_codepoint_t
text_from_data
[
16
];
if
(
size
>
sizeof
(
text_from_data
))
{
...
...
@@ -51,8 +65,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
data
+
size
-
sizeof
(
text_from_data
),
sizeof
(
text_from_data
));
unsigned
int
text_size
=
sizeof
(
text_from_data
)
/
sizeof
(
hb_codepoint_t
);
trySubset
(
face
,
text_from_data
,
text_size
,
true
);
trySubset
(
face
,
text_from_data
,
text_size
,
false
);
trySubset
(
face
,
text_from_data
,
text_size
);
}
hb_face_destroy
(
face
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录