未验证 提交 7850741d 编写于 作者: O openharmony_ci 提交者: Gitee

!577 fix: fuzz code adapt rk3568 arm64

Merge pull request !577 from Mupceet/0505fuzz
......@@ -21,7 +21,8 @@ namespace OHOS {
bool FuzzSystemDumpParameters(const uint8_t* data, size_t size)
{
CloseStdout();
SystemDumpParameters(reinterpret_cast<int>(data));
int verbose = atoi(reinterpret_cast<char *>(const_cast<uint8_t *>(data)));
SystemDumpParameters(verbose);
return true;
}
}
......
......@@ -14,6 +14,7 @@
*/
#include "systemgetparametercommitid_fuzzer.h"
#include "fuzz_utils.h"
#include "sys_param.h"
namespace OHOS {
......@@ -21,7 +22,9 @@ namespace OHOS {
{
bool result = false;
uint32_t commitId = 0;
if (!SystemGetParameterCommitId(reinterpret_cast<ParamHandle>(data), &commitId)) {
char *rest = nullptr;
ParamHandle handle = (ParamHandle)strtoul(reinterpret_cast<char *>(const_cast<uint8_t *>(data)), &rest, BASE);
if (!SystemGetParameterCommitId(handle, &commitId)) {
result = true;
}
return result;
......
......@@ -14,6 +14,7 @@
*/
#include "systemgetparametername_fuzzer.h"
#include "fuzz_utils.h"
#include "sys_param.h"
namespace OHOS {
......@@ -21,7 +22,9 @@ namespace OHOS {
{
bool result = false;
char buffer[PARAM_NAME_LEN_MAX] = {0};
if (!SystemGetParameterName(reinterpret_cast<ParamHandle>(data), buffer, PARAM_NAME_LEN_MAX)) {
char *rest = nullptr;
ParamHandle handle = (ParamHandle)strtoul(reinterpret_cast<char *>(const_cast<uint8_t *>(data)), &rest, BASE);
if (!SystemGetParameterName(handle, buffer, PARAM_NAME_LEN_MAX)) {
result = true;
}
return result;
......
......@@ -14,6 +14,7 @@
*/
#include "systemgetparametervalue_fuzzer.h"
#include "fuzz_utils.h"
#include "sys_param.h"
namespace OHOS {
......@@ -22,7 +23,9 @@ namespace OHOS {
bool result = false;
char buffer[PARAM_CONST_VALUE_LEN_MAX] = {0};
uint32_t len = PARAM_CONST_VALUE_LEN_MAX;
if (!SystemGetParameterValue(reinterpret_cast<ParamHandle>(data), buffer, &len)) {
char *rest = nullptr;
ParamHandle handle = (ParamHandle)strtoul(reinterpret_cast<char *>(const_cast<uint8_t *>(data)), &rest, BASE);
if (!SystemGetParameterValue(handle, buffer, &len)) {
result = true;
}
return result;
......
......@@ -18,5 +18,6 @@
#include <stdint.h>
#include <stdlib.h>
#define BASE 10
void CloseStdout(void);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册