diff --git a/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp b/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp index d2916c73b40393e2aad2e4bde6a533623a1eb72d..e5df50ce15653d981cd4e77e5787a1e00841d93a 100644 --- a/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp +++ b/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -69,12 +69,8 @@ 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 == 0 || size > OHOS::FOO_MAX_LEN) { + if (size < OHOS::U32_AT_SIZE || size > OHOS::FOO_MAX_LEN) { return 0; } diff --git a/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.h b/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.h index 8c78aa05118fe38dc5afde11d58183f7a78109eb..16d982fef1bea79d7d9b0cd75184fbf0e2d8ec79 100644 --- a/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.h +++ b/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at