Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
1d70b1f7
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
1d70b1f7
编写于
8月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1097 解决fuzztest用例未对测试输入处理的问题
Merge pull request !1097 from cheng_jinsong/master_cc_fuzz
上级
8c999229
1af9b877
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
52 addition
and
15 deletion
+52
-15
test/fuzztest/doreboot_fuzzer/doreboot_fuzzer.cpp
test/fuzztest/doreboot_fuzzer/doreboot_fuzzer.cpp
+3
-1
test/fuzztest/getcontrolfile_fuzzer/getcontrolfile_fuzzer.cpp
.../fuzztest/getcontrolfile_fuzzer/getcontrolfile_fuzzer.cpp
+7
-1
test/fuzztest/getcontrolsocket_fuzzer/getcontrolsocket_fuzzer.cpp
...ztest/getcontrolsocket_fuzzer/getcontrolsocket_fuzzer.cpp
+3
-1
test/fuzztest/servicecontrolstart_fuzzer/servicecontrolstart_fuzzer.cpp
...servicecontrolstart_fuzzer/servicecontrolstart_fuzzer.cpp
+3
-1
test/fuzztest/servicecontrolstop_fuzzer/servicecontrolstop_fuzzer.cpp
...t/servicecontrolstop_fuzzer/servicecontrolstop_fuzzer.cpp
+3
-1
test/fuzztest/systemdumpparameters_fuzzer/systemdumpparameters_fuzzer.cpp
...stemdumpparameters_fuzzer/systemdumpparameters_fuzzer.cpp
+3
-1
test/fuzztest/systemfindparameter_fuzzer/systemfindparameter_fuzzer.cpp
...systemfindparameter_fuzzer/systemfindparameter_fuzzer.cpp
+3
-1
test/fuzztest/systemgetparameter_fuzzer/systemgetparameter_fuzzer.cpp
...t/systemgetparameter_fuzzer/systemgetparameter_fuzzer.cpp
+3
-1
test/fuzztest/systemgetparametercommitid_fuzzer/systemgetparametercommitid_fuzzer.cpp
...etercommitid_fuzzer/systemgetparametercommitid_fuzzer.cpp
+3
-1
test/fuzztest/systemgetparametername_fuzzer/systemgetparametername_fuzzer.cpp
...getparametername_fuzzer/systemgetparametername_fuzzer.cpp
+3
-1
test/fuzztest/systemgetparametervalue_fuzzer/systemgetparametervalue_fuzzer.cpp
...tparametervalue_fuzzer/systemgetparametervalue_fuzzer.cpp
+3
-1
test/fuzztest/systemsetparameter_fuzzer/systemsetparameter_fuzzer.cpp
...t/systemsetparameter_fuzzer/systemsetparameter_fuzzer.cpp
+3
-1
test/fuzztest/systemtraversalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
...ersalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
+6
-1
test/fuzztest/systemwaitparameter_fuzzer/systemwaitparameter_fuzzer.cpp
...systemwaitparameter_fuzzer/systemwaitparameter_fuzzer.cpp
+3
-1
test/fuzztest/systemwatchparameter_fuzzer/systemwatchparameter_fuzzer.cpp
...stemwatchparameter_fuzzer/systemwatchparameter_fuzzer.cpp
+3
-1
未找到文件。
test/fuzztest/doreboot_fuzzer/doreboot_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "doreboot_fuzzer.h"
#include<string>
#include "init_reboot.h"
namespace
OHOS
{
bool
FuzzDoReboot
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
DoReboot
(
reinterpret_cast
<
const
char
*>
(
data
)))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
DoReboot
(
str
.
c_str
()))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/getcontrolfile_fuzzer/getcontrolfile_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,19 @@
*/
#include "getcontrolfile_fuzzer.h"
#include <string>
#include <climits>
#include "init_file.h"
namespace
OHOS
{
bool
FuzzGetControlFile
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
GetControlFile
(
reinterpret_cast
<
const
char
*>
(
data
)))
{
if
(
size
>
PATH_MAX
)
{
return
true
;
}
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
GetControlFile
(
str
.
c_str
()))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/getcontrolsocket_fuzzer/getcontrolsocket_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "getcontrolsocket_fuzzer.h"
#include <string>
#include "init_socket.h"
namespace
OHOS
{
bool
FuzzGetControlSocket
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
GetControlSocket
(
reinterpret_cast
<
const
char
*>
(
data
)))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
GetControlSocket
(
str
.
c_str
()))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/servicecontrolstart_fuzzer/servicecontrolstart_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "servicecontrolstart_fuzzer.h"
#include<string>
#include "service_control.h"
namespace
OHOS
{
bool
FuzzServiceControlStart
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
ServiceControl
(
reinterpret_cast
<
const
char
*>
(
data
),
START
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
ServiceControl
(
str
.
c_str
(),
START
))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/servicecontrolstop_fuzzer/servicecontrolstop_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "servicecontrolstop_fuzzer.h"
#include <string>
#include "service_control.h"
namespace
OHOS
{
bool
FuzzServiceControlStop
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
ServiceControl
(
reinterpret_cast
<
const
char
*>
(
data
),
STOP
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
ServiceControl
(
str
.
c_str
(),
STOP
))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/systemdumpparameters_fuzzer/systemdumpparameters_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemdumpparameters_fuzzer.h"
#include <string>
#include "init_param.h"
#include "fuzz_utils.h"
...
...
@@ -21,7 +22,8 @@ namespace OHOS {
bool
FuzzSystemDumpParameters
(
const
uint8_t
*
data
,
size_t
size
)
{
CloseStdout
();
int
verbose
=
atoi
(
reinterpret_cast
<
char
*>
(
const_cast
<
uint8_t
*>
(
data
)));
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
int
verbose
=
atoi
(
str
.
c_str
());
SystemDumpParameters
(
verbose
);
return
true
;
}
...
...
test/fuzztest/systemfindparameter_fuzzer/systemfindparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemfindparameter_fuzzer.h"
#include<string>
#include "init_param.h"
static
ParamHandle
handle
;
...
...
@@ -22,7 +23,8 @@ namespace OHOS {
bool
FuzzSystemFindParameter
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
SystemFindParameter
(
reinterpret_cast
<
const
char
*>
(
data
),
&
handle
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
SystemFindParameter
(
str
.
c_str
(),
&
handle
))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/systemgetparameter_fuzzer/systemgetparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemgetparameter_fuzzer.h"
#include<string>
#include "init_param.h"
...
...
@@ -23,7 +24,8 @@ namespace OHOS {
bool
result
=
false
;
char
buffer
[
PARAM_CONST_VALUE_LEN_MAX
]
=
{
0
};
uint32_t
len
=
PARAM_CONST_VALUE_LEN_MAX
;
if
(
!
SystemGetParameter
(
reinterpret_cast
<
const
char
*>
(
data
),
buffer
,
&
len
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
SystemGetParameter
(
str
.
c_str
(),
buffer
,
&
len
))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/systemgetparametercommitid_fuzzer/systemgetparametercommitid_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemgetparametercommitid_fuzzer.h"
#include <string>
#include "init_param.h"
#include "fuzz_utils.h"
...
...
@@ -23,7 +24,8 @@ namespace OHOS {
bool
result
=
false
;
uint32_t
commitId
=
0
;
char
*
rest
=
nullptr
;
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
reinterpret_cast
<
char
*>
(
const_cast
<
uint8_t
*>
(
data
)),
&
rest
,
BASE
);
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
str
.
c_str
(),
&
rest
,
BASE
);
if
(
!
SystemGetParameterCommitId
(
handle
,
&
commitId
))
{
result
=
true
;
}
...
...
test/fuzztest/systemgetparametername_fuzzer/systemgetparametername_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemgetparametername_fuzzer.h"
#include <string>
#include "init_param.h"
#include "fuzz_utils.h"
...
...
@@ -23,7 +24,8 @@ namespace OHOS {
bool
result
=
false
;
char
buffer
[
PARAM_NAME_LEN_MAX
]
=
{
0
};
char
*
rest
=
nullptr
;
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
reinterpret_cast
<
char
*>
(
const_cast
<
uint8_t
*>
(
data
)),
&
rest
,
BASE
);
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
str
.
c_str
(),
&
rest
,
BASE
);
if
(
!
SystemGetParameterName
(
handle
,
buffer
,
PARAM_NAME_LEN_MAX
))
{
result
=
true
;
}
...
...
test/fuzztest/systemgetparametervalue_fuzzer/systemgetparametervalue_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,6 +14,7 @@
*/
#include "systemgetparametervalue_fuzzer.h"
#include <string>
#include "init_param.h"
#include "fuzz_utils.h"
...
...
@@ -24,7 +25,8 @@ namespace OHOS {
char
buffer
[
PARAM_CONST_VALUE_LEN_MAX
]
=
{
0
};
uint32_t
len
=
PARAM_CONST_VALUE_LEN_MAX
;
char
*
rest
=
nullptr
;
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
reinterpret_cast
<
char
*>
(
const_cast
<
uint8_t
*>
(
data
)),
&
rest
,
BASE
);
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
ParamHandle
handle
=
(
ParamHandle
)
strtoul
(
str
.
c_str
(),
&
rest
,
BASE
);
if
(
!
SystemGetParameterValue
(
handle
,
buffer
,
&
len
))
{
result
=
true
;
}
...
...
test/fuzztest/systemsetparameter_fuzzer/systemsetparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "systemsetparameter_fuzzer.h"
#include <string>
#include "init_param.h"
namespace
OHOS
{
bool
FuzzSystemSetParameter
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
SystemSetParameter
(
reinterpret_cast
<
const
char
*>
(
data
),
reinterpret_cast
<
const
char
*>
(
data
)))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
SystemSetParameter
(
str
.
c_str
(),
str
.
c_str
()))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/systemtraversalparameter_fuzzer/systemtraversalparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -15,6 +15,7 @@
#include "systemtraversalparameter_fuzzer.h"
#include <string>
#include "fuzz_utils.h"
#include "init.h"
#include "securec.h"
...
...
@@ -42,12 +43,16 @@ namespace OHOS {
if
(
size
<=
0
)
{
return
false
;
}
if
(
size
>
PARAM_CONST_VALUE_LEN_MAX
+
PARAM_NAME_LEN_MAX
)
{
return
true
;
}
cookie
->
data
=
static_cast
<
char
*>
(
malloc
(
size
));
if
(
cookie
->
data
==
nullptr
)
{
return
true
;
}
cookie
->
size
=
size
;
int
ret
=
memcpy_s
(
cookie
->
data
,
size
,
data
,
size
);
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
-
1
);
int
ret
=
memcpy_s
(
cookie
->
data
,
size
,
str
.
c_str
(),
size
);
if
(
ret
!=
EOK
)
{
return
false
;
}
...
...
test/fuzztest/systemwaitparameter_fuzzer/systemwaitparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -14,13 +14,15 @@
*/
#include "systemwaitparameter_fuzzer.h"
#include <string>
#include "init_param.h"
namespace
OHOS
{
bool
FuzzSystemWaitParameter
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
SystemWaitParameter
(
reinterpret_cast
<
const
char
*>
(
data
),
reinterpret_cast
<
const
char
*>
(
data
),
1
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
SystemWaitParameter
(
str
.
c_str
(),
str
.
c_str
(),
1
))
{
result
=
true
;
}
return
result
;
...
...
test/fuzztest/systemwatchparameter_fuzzer/systemwatchparameter_fuzzer.cpp
浏览文件 @
1d70b1f7
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
#include<string>
#include "systemwatchparameter_fuzzer.h"
#include "init.h"
...
...
@@ -31,7 +32,8 @@ namespace OHOS {
bool
FuzzSystemWatchParameter
(
const
uint8_t
*
data
,
size_t
size
)
{
bool
result
=
false
;
if
(
!
SystemWatchParameter
(
reinterpret_cast
<
const
char
*>
(
data
),
HandleParamChange
,
NULL
))
{
std
::
string
str
(
reinterpret_cast
<
const
char
*>
(
data
),
size
);
if
(
!
SystemWatchParameter
(
str
.
c_str
(),
HandleParamChange
,
NULL
))
{
result
=
true
;
}
return
result
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录