mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2025-02-17 05:20:39 +00:00
FUZZ告警清理
Signed-off-by: lixiyuan <lixiyuan7@huawei.com>
This commit is contained in:
parent
4d4f876d04
commit
0fdb9b17e8
@ -18,11 +18,22 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace OHOS {
|
||||
template<typename T>
|
||||
T TypeCast(const uint8_t *data, int *pos)
|
||||
{
|
||||
if (pos) {
|
||||
*pos += sizeof(T);
|
||||
}
|
||||
return *(reinterpret_cast<const T*>(data));
|
||||
}
|
||||
|
||||
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
|
||||
{
|
||||
if ((data == nullptr) || (size == 0)) {
|
||||
return false;
|
||||
if ((data == nullptr) || (size <sizeof(uint64_t) * 6)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t total = TypeCast<int64_t>(data, nullptr);
|
||||
Parcel parcel;
|
||||
StorageManager::BundleStats bundlestats;
|
||||
bundlestats.Marshalling(parcel);
|
||||
|
@ -18,6 +18,15 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace OHOS {
|
||||
template<typename T>
|
||||
T TypeCast(const uint8_t *data, int *pos)
|
||||
{
|
||||
if (pos) {
|
||||
*pos += sizeof(T);
|
||||
}
|
||||
return *(reinterpret_cast<const T*>(data));
|
||||
}
|
||||
|
||||
bool FileUtilFuzzTest(const uint8_t *data, size_t size)
|
||||
{
|
||||
if ((data == nullptr) || (size == 0)) {
|
||||
|
@ -18,6 +18,15 @@
|
||||
#include "storage_service_errno.h"
|
||||
namespace OHOS {
|
||||
namespace StorageManager {
|
||||
template<typename T>
|
||||
T TypeCast(const uint8_t *data, int *pos)
|
||||
{
|
||||
if (pos) {
|
||||
*pos += sizeof(T);
|
||||
}
|
||||
return *(reinterpret_cast<const T*>(data));
|
||||
}
|
||||
|
||||
bool StorageTotalStatusServiceFuzzTest(const uint8_t *data, size_t size)
|
||||
{
|
||||
if ((data == nullptr) || (size == 0)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user