update test/fuzztest/distributedschedstub_fuzzer/distributedschedstub_fuzzer.cpp.

Signed-off-by: 师皓杰 <shihaojie10@huawei.com>
This commit is contained in:
师皓杰 2024-07-25 01:55:04 +00:00 committed by Gitee
parent ab7679479f
commit d02ec23ff1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -42,6 +42,10 @@ const uint32_t ONE = 1;
uint32_t GetU32Data(const uint8_t* ptr, size_t size)
{
char *ch = (char *)malloc(size + 1);
if (ch == nullptr) {
std::cout << "malloc failed." << std::endl;
return 0;
}
(void)memset_s(ch, size + 1, 0x00, size + 1);
if (memcpy_s(ch, size + 1, ptr, size) != EOK) {
std::cout << "copy failed." << std::endl;