From d959374110e2e93c53896a1ba0a6c5eb25d895b9 Mon Sep 17 00:00:00 2001 From: "liuyanzhi3@huawei.com" Date: Fri, 11 Nov 2022 08:14:53 +0800 Subject: [PATCH] fix fuzz Signed-off-by: liuyanzhi3@huawei.com Change-Id: I7d7ab88acec4cffc6a901594e84b604be265b898 --- .../notificationconversationalcontent_fuzzer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp b/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp index d84384286..1139f3189 100644 --- a/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp +++ b/test/fuzztest/notificationconversationalcontent_fuzzer/notificationconversationalcontent_fuzzer.cpp @@ -20,6 +20,7 @@ #undef protected #include "notificationconversationalcontent_fuzzer.h" +#define DISABLE_FUZZ namespace OHOS { namespace { constexpr uint8_t ENABLE = 2; @@ -54,7 +55,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) /* Run your code on data */ char *ch = ParseData(data, size); if (ch != nullptr && size >= GetU32Size()) { +#ifndef DISABLE_FUZZ OHOS::DoSomethingInterestingWithMyAPI(ch, size); +#endif free(ch); ch = nullptr; } -- Gitee