mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-27 09:20:49 +00:00
update test/fuzztest/fuzztest_application/bundleinstalldhost_fuzzer/bundleinstalldhost_fuzzer.cpp.
Signed-off-by: Lotol <linxiangzhi@huawei.com>
This commit is contained in:
parent
f1ba7534dc
commit
3f280997ba
@ -58,6 +58,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (size < OHOS::U32_AT_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Validate the length of size */
|
||||
if (size > OHOS::FOO_MAX_LEN) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* ch = static_cast<char*>(malloc(size + 1));
|
||||
if (ch == nullptr) {
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user