mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-20 04:23:45 -04:00
Signed-off-by: lovechinamo <wangdongqi2@huawei.com>
Changes to be committed:
This commit is contained in:
@@ -14,10 +14,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "inputclientstub_fuzzer.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include "input_client_stub.h"
|
||||
#include "global.h"
|
||||
|
||||
@@ -31,11 +32,11 @@ namespace OHOS {
|
||||
|
||||
uint32_t ConvertToUint32(const uint8_t *ptr)
|
||||
{
|
||||
if (ptr == nullptr)
|
||||
{
|
||||
if (ptr == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | (ptr[3]);
|
||||
uint32_t bigvar = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | (ptr[3]);
|
||||
return bigvar;
|
||||
}
|
||||
bool FuzzInputClientStub(const uint8_t* rawData, size_t size)
|
||||
{
|
||||
@@ -59,8 +60,7 @@ namespace OHOS {
|
||||
/* Fuzzer entry point */
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
if (size < OHOS::THRESHOLD)
|
||||
{
|
||||
if (size < OHOS::THRESHOLD) {
|
||||
return -1;
|
||||
}
|
||||
/* Run your code on data */
|
||||
|
||||
Reference in New Issue
Block a user