Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1cd1e117
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看板
提交
1cd1e117
编写于
5月 05, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove SANITIZE_ARRAY
上级
583d7f95
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
16 deletion
+14
-16
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+1
-1
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+7
-9
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+4
-4
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+2
-2
未找到文件。
src/hb-open-file-private.hh
浏览文件 @
1cd1e117
...
...
@@ -101,7 +101,7 @@ typedef struct OffsetTable
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
)
{
TRACE_SANITIZE
();
return
SANITIZE_SELF
()
&&
SANITIZE_ARRAY
(
tableDir
,
TableDirectory
::
get_size
(),
numTables
);
&&
context
->
check_array
(
tableDir
,
TableDirectory
::
get_size
(),
numTables
);
}
private:
...
...
src/hb-open-type-private.hh
浏览文件 @
1cd1e117
...
...
@@ -181,24 +181,24 @@ struct hb_sanitize_context_t
this
->
start
=
this
->
end
=
NULL
;
}
inline
bool
check
(
const
char
*
base
,
unsigned
int
len
)
const
inline
bool
check
(
const
void
*
base
,
unsigned
int
len
)
const
{
bool
ret
=
this
->
start
<=
base
&&
base
<=
this
->
end
&&
(
unsigned
int
)
(
this
->
end
-
base
)
>=
len
;
(
unsigned
int
)
(
this
->
end
-
CharP
(
base
)
)
>=
len
;
if
(
HB_DEBUG_SANITIZE
&&
(
int
)
this
->
debug_depth
<
(
int
)
HB_DEBUG_SANITIZE
)
\
fprintf
(
stderr
,
"SANITIZE(%p) %-*d-> check [%p..%p] (%d bytes) in [%p..%p] -> %s
\n
"
,
\
base
,
this
->
debug_depth
,
this
->
debug_depth
,
base
,
base
+
len
,
len
,
base
,
CharP
(
base
)
+
len
,
len
,
this
->
start
,
this
->
end
,
ret
?
"pass"
:
"FAIL"
);
return
likely
(
ret
);
}
inline
bool
check_array
(
const
char
*
base
,
unsigned
int
record_size
,
unsigned
int
len
)
const
inline
bool
check_array
(
const
void
*
base
,
unsigned
int
record_size
,
unsigned
int
len
)
const
{
bool
overflows
=
len
>=
((
unsigned
int
)
-
1
)
/
record_size
;
...
...
@@ -207,7 +207,7 @@ struct hb_sanitize_context_t
fprintf
(
stderr
,
"SANITIZE(%p) %-*d-> array [%p..%p] (%d*%d=%ld bytes) in [%p..%p] -> %s
\n
"
,
\
base
,
this
->
debug_depth
,
this
->
debug_depth
,
base
,
base
+
(
record_size
*
len
),
record_size
,
len
,
(
unsigned
long
)
record_size
*
len
,
base
,
CharP
(
base
)
+
(
record_size
*
len
),
record_size
,
len
,
(
unsigned
long
)
record_size
*
len
,
this
->
start
,
this
->
end
,
!
overflows
?
"does not overflow"
:
"OVERFLOWS FAIL"
);
...
...
@@ -246,8 +246,6 @@ struct hb_sanitize_context_t
#define SANITIZE_MEM(B,L) likely (context->check (CharP(B), (L)))
#define SANITIZE_ARRAY(A,S,L) likely (context->check_array (CharP(A), S, L))
/* Template to sanitize an object. */
template
<
typename
Type
>
...
...
@@ -556,7 +554,7 @@ struct GenericArrayOf
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
context
)
{
TRACE_SANITIZE
();
return
SANITIZE_SELF
()
&&
SANITIZE_ARRAY
(
this
,
Type
::
get_size
(),
len
);
&&
context
->
check_array
(
this
,
Type
::
get_size
(),
len
);
}
public:
...
...
@@ -624,7 +622,7 @@ struct HeadlessArrayOf
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
context
)
{
return
SANITIZE_SELF
()
&&
SANITIZE_ARRAY
(
this
,
Type
::
get_size
(),
len
);
&&
context
->
check_array
(
this
,
Type
::
get_size
(),
len
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
)
{
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
1cd1e117
...
...
@@ -167,7 +167,7 @@ struct ValueFormat : USHORT
TRACE_SANITIZE
();
unsigned
int
len
=
get_len
();
if
(
!
SANITIZE_ARRAY
(
values
,
get_size
(),
count
))
return
false
;
if
(
!
context
->
check_array
(
values
,
get_size
(),
count
))
return
false
;
if
(
!
has_device
())
return
true
;
...
...
@@ -341,7 +341,7 @@ struct AnchorMatrix
if
(
!
SANITIZE_SELF
())
return
false
;
if
(
unlikely
(
cols
>=
((
unsigned
int
)
-
1
)
/
rows
))
return
false
;
unsigned
int
count
=
rows
*
cols
;
if
(
!
SANITIZE_ARRAY
(
matrix
,
matrix
[
0
].
get_size
(),
count
))
return
false
;
if
(
!
context
->
check_array
(
matrix
,
matrix
[
0
].
get_size
(),
count
))
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
!
SANITIZE_WITH_BASE
(
this
,
matrix
[
i
]))
return
false
;
return
true
;
...
...
@@ -557,7 +557,7 @@ struct PairSet
TRACE_SANITIZE
();
if
(
!
SANITIZE_SELF
())
return
false
;
unsigned
int
count
=
(
1
+
format_len
)
*
len
;
return
SANITIZE_ARRAY
(
array
,
USHORT
::
get_size
(),
count
);
return
context
->
check_array
(
array
,
USHORT
::
get_size
(),
count
);
}
private:
...
...
@@ -717,7 +717,7 @@ struct PairPosFormat2
unsigned
int
stride
=
len1
+
len2
;
unsigned
int
record_size
=
valueFormat1
.
get_size
()
+
valueFormat2
.
get_size
();
unsigned
int
count
=
(
unsigned
int
)
class1Count
*
(
unsigned
int
)
class2Count
;
return
SANITIZE_ARRAY
(
values
,
record_size
,
count
)
&&
return
context
->
check_array
(
values
,
record_size
,
count
)
&&
valueFormat1
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
),
&
values
[
0
],
count
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
),
&
values
[
len1
],
count
,
stride
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
1cd1e117
...
...
@@ -445,11 +445,11 @@ struct ContextFormat3
TRACE_SANITIZE
();
if
(
!
SANITIZE_SELF
())
return
false
;
unsigned
int
count
=
glyphCount
;
if
(
!
SANITIZE_ARRAY
(
coverage
,
OffsetTo
<
Coverage
>::
get_size
(),
count
))
return
false
;
if
(
!
context
->
check_array
(
coverage
,
OffsetTo
<
Coverage
>::
get_size
(),
count
))
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
!
SANITIZE_WITH_BASE
(
this
,
coverage
[
i
]))
return
false
;
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
coverage
,
OffsetTo
<
Coverage
>::
get_size
()
*
count
);
return
SANITIZE_ARRAY
(
lookupRecord
,
LookupRecord
::
get_size
(),
lookupCount
);
return
context
->
check_array
(
lookupRecord
,
LookupRecord
::
get_size
(),
lookupCount
);
}
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录