diff --git a/test/fuzztest/getcfgfiles_fuzzer/getcfgfiles_fuzzer.cpp b/test/fuzztest/getcfgfiles_fuzzer/getcfgfiles_fuzzer.cpp index 3d7f621cec3993d68bd93f066e9b78e9574d39b3..f238cc1f7c5ad729eb40ae299ead9d137d5d26d8 100644 --- a/test/fuzztest/getcfgfiles_fuzzer/getcfgfiles_fuzzer.cpp +++ b/test/fuzztest/getcfgfiles_fuzzer/getcfgfiles_fuzzer.cpp @@ -25,7 +25,7 @@ namespace OHOS { bool FuzzGetCfgFiles(const uint8_t* data, size_t size) { - std::string cfgPath((const char*) data, size); + std::string cfgPath(reinterpret_cast(data), size); CfgFiles *cfgFiles = GetCfgFiles(cfgPath.c_str()); bool result = cfgFiles != nullptr; FreeCfgFiles(cfgFiles); diff --git a/test/fuzztest/getcfgfilesex_fuzzer/getcfgfilesex_fuzzer.cpp b/test/fuzztest/getcfgfilesex_fuzzer/getcfgfilesex_fuzzer.cpp index 7679a2153f171aabbaaa0fc6f0b7a36fbab2dabf..7a7cc16b0b0dc09a25b38c9b00be63338cbbf0b5 100644 --- a/test/fuzztest/getcfgfilesex_fuzzer/getcfgfilesex_fuzzer.cpp +++ b/test/fuzztest/getcfgfilesex_fuzzer/getcfgfilesex_fuzzer.cpp @@ -26,8 +26,8 @@ constexpr size_t MIN_SIZE = 4; namespace OHOS { bool FuzzGetCfgFilesEx(const uint8_t* data, size_t size) { - std::string cfgPath((const char*) data, size / 2); - std::string extra((const char*) data + size / 2, size - size / 2); + std::string cfgPath(reinterpret_cast(data), size / 2); + std::string extra(reinterpret_cast(data) + size / 2, size - size / 2); int followMode = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; CfgFiles *cfgFiles = GetCfgFilesEx(cfgPath.c_str(), followMode, extra.c_str()); bool result = cfgFiles != nullptr; diff --git a/test/fuzztest/getonecfgfile_fuzzer/getonecfgfile_fuzzer.cpp b/test/fuzztest/getonecfgfile_fuzzer/getonecfgfile_fuzzer.cpp index 1d6d43f6469336d78e1239c749e5cd29f9e31b49..47b94c2b21a0e3872c3b60d39b61a68241fe6997 100644 --- a/test/fuzztest/getonecfgfile_fuzzer/getonecfgfile_fuzzer.cpp +++ b/test/fuzztest/getonecfgfile_fuzzer/getonecfgfile_fuzzer.cpp @@ -25,7 +25,7 @@ namespace OHOS { bool FuzzGetOneCfgFile(const uint8_t* data, size_t size) { - std::string userPath((const char*) data, size); + std::string userPath(reinterpret_cast(data), size); char buf[MAX_PATH_LEN] = {0}; char *filePath = GetOneCfgFile(userPath.c_str(), buf, MAX_PATH_LEN); return filePath != nullptr; diff --git a/test/fuzztest/getonecfgfileex_fuzzer/getonecfgfileex_fuzzer.cpp b/test/fuzztest/getonecfgfileex_fuzzer/getonecfgfileex_fuzzer.cpp index 5224a373e3cf4fb276ddfa97144e517594fded9b..2439cd7ff333b1216415d9072715f66990ebff74 100644 --- a/test/fuzztest/getonecfgfileex_fuzzer/getonecfgfileex_fuzzer.cpp +++ b/test/fuzztest/getonecfgfileex_fuzzer/getonecfgfileex_fuzzer.cpp @@ -26,8 +26,8 @@ constexpr size_t MIN_SIZE = 4; namespace OHOS { bool FuzzGetOneCfgFileEx(const uint8_t* data, size_t size) { - std::string userPath((const char*) data, size / 2); - std::string extra((const char*) data + size / 2, size - size / 2); + std::string userPath(reinterpret_cast(data), size / 2); + std::string extra(reinterpret_cast(data) + size / 2, size - size / 2); int followMode = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; char buf[MAX_PATH_LEN] = {0}; char *filePath = GetOneCfgFileEx(userPath.c_str(), buf, MAX_PATH_LEN, followMode, extra.c_str());