From 4d5767d804ef7e33587376e58c3e5843834e9d8e Mon Sep 17 00:00:00 2001 From: y30045862 Date: Fri, 21 Jul 2023 12:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E5=A4=8D=20Signed-o?= =?UTF-8?q?ff-by:=20yangjingbo10=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic087dcccf5b633ffcf24bf6ab392b47409daca6e --- test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp | 8 ++------ test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp b/test/fuzztest/backupsa_fuzzer/backupsa_fuzzer.cpp index d2916c73b..e5df50ce1 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 8c78aa051..16d982fef 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 -- Gitee