update test/fuzztest/stringutils_fuzzer/stringutils_fuzzer.cpp.

Signed-off-by: zhuhongtao666 <zhuhongtao12@huawei.com>
This commit is contained in:
zhuhongtao666 2022-11-17 10:58:26 +00:00 committed by zhuhongtao66
parent 662641a0aa
commit d02ec00de6
11 changed files with 12 additions and 12 deletions

View File

@ -20,7 +20,7 @@
namespace OHOS {
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}
Parcel parcel;

View File

@ -20,7 +20,7 @@
namespace OHOS {
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(uint32_t))) {
if ((data == nullptr) || (size < sizeof(uint32_t))) {
return false;
}
unsigned int ustate = *(reinterpret_cast<const unsigned int *>(data));

View File

@ -21,7 +21,7 @@
namespace OHOS {
bool FscryptUtilsFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(char))) {
if ((data == nullptr) || (size < sizeof(char))) {
return false;
}
char character = *(reinterpret_cast<const char *>(data));

View File

@ -21,7 +21,7 @@
namespace OHOS {
bool SysparamDynamicFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int))) {
if ((data == nullptr) || (size < sizeof(int))) {
return false;
}
struct fscrypt_policy fscryptpolicy;

View File

@ -20,7 +20,7 @@
namespace OHOS {
bool RedactionUtilsFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}
int32_t state32 = *(reinterpret_cast<const int32_t *>(data));

View File

@ -22,7 +22,7 @@ namespace OHOS {
namespace StorageManager {
bool StorageManagerProxyFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}
VolumeCore vc;
@ -69,7 +69,7 @@ bool StorageManagerProxyFuzzTest(const uint8_t *data, size_t size)
bool StorageManagerProxyGetFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}

View File

@ -21,7 +21,7 @@
namespace OHOS {
bool StringUtilsFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(string))) {
if ((data == nullptr) || (size < sizeof(char))) {
return false;
}
std::string metaData(reinterpret_cast<const char *>(data), size);

View File

@ -21,7 +21,7 @@
namespace OHOS {
bool SysparamDynamicFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(unsigned int))) {
if ((data == nullptr) || (size < sizeof(unsigned int))) {
return false;
}
char character = *(reinterpret_cast<const char *>(data));

View File

@ -21,7 +21,7 @@
namespace OHOS {
bool SysparamStaticFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(unsigned int))) {
if ((data == nullptr) || (size < sizeof(unsigned int))) {
return false;
}
char character = *(reinterpret_cast<const char *>(data));

View File

@ -20,7 +20,7 @@
namespace OHOS {
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}
Parcel parcel;

View File

@ -20,7 +20,7 @@
namespace OHOS {
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
{
if ((data == nullptr) || (size <= sizeof(int32_t))) {
if ((data == nullptr) || (size < sizeof(int32_t))) {
return false;
}
Parcel parcel;