From ee7cf8542891c28a740412ad8d6a2c506abbeb72 Mon Sep 17 00:00:00 2001 From: qinlong Date: Tue, 27 Sep 2022 11:32:13 +0800 Subject: [PATCH] =?UTF-8?q?FUZZ=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinlong --- .../onremotesinksvrdied_fuzzer.cpp | 4 ++-- .../proxyinitsink_fuzzer/initsink_fuzzer.cpp | 2 +- .../subscribelocalhardware_fuzzer.cpp | 2 +- .../unsubscribelocalhardware_fuzzer.cpp | 2 +- .../sinkproxydscreennotify_fuzzer.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/onremotesinksvrdied_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/onremotesinksvrdied_fuzzer.cpp index 52a91ac0..6962303e 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/onremotesinksvrdied_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_handler/handleronremotesinksvrdied_fuzzer/onremotesinksvrdied_fuzzer.cpp @@ -26,7 +26,7 @@ namespace OHOS { namespace DistributedHardware { void OnRemoteSinkSvrDiedFuzzTest(const uint8_t* data, size_t size) { - if ((data == nullptr) || (size <= 0)) { + if ((data == nullptr) || (size < sizeof(int32_t))) { return; } @@ -34,7 +34,7 @@ void OnRemoteSinkSvrDiedFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (samgr != nullptr) { + if (samgr == nullptr) { return; } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/initsink_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/initsink_fuzzer.cpp index a4890048..df1d4c35 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/initsink_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyinitsink_fuzzer/initsink_fuzzer.cpp @@ -27,7 +27,7 @@ namespace OHOS { namespace DistributedHardware { void InitSinkFuzzTest(const uint8_t* data, size_t size) { - if ((data == nullptr) || (size <= sizeof(int32_t))) { + if ((data == nullptr) || (size <= 0)) { return; } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/subscribelocalhardware_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/subscribelocalhardware_fuzzer.cpp index c3db6e4c..c0dcb6d4 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/subscribelocalhardware_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxysubscribelocalhardware_fuzzer/subscribelocalhardware_fuzzer.cpp @@ -27,7 +27,7 @@ namespace OHOS { namespace DistributedHardware { void SubscribeLocalHardwareFuzzTest(const uint8_t* data, size_t size) { - if ((data == nullptr) || (size <= sizeof(int32_t))) { + if ((data == nullptr) || (size <= 0)) { return; } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/unsubscribelocalhardware_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/unsubscribelocalhardware_fuzzer.cpp index e98d94ee..6d0596f2 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/unsubscribelocalhardware_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/proxyunsubscribelocalhardware_fuzzer/unsubscribelocalhardware_fuzzer.cpp @@ -27,7 +27,7 @@ namespace OHOS { namespace DistributedHardware { void UnsubscribeLocalHardwareFuzzTest(const uint8_t* data, size_t size) { - if ((data == nullptr) || (size <= sizeof(int32_t))) { + if ((data == nullptr) || (size <= 0)) { return; } diff --git a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/sinkproxydscreennotify_fuzzer.cpp b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/sinkproxydscreennotify_fuzzer.cpp index 9d3ecdb3..f33a9c7c 100644 --- a/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/sinkproxydscreennotify_fuzzer.cpp +++ b/interfaces/innerkits/native_cpp/test/fuzztest/dscreen_sink_proxy/sinkproxydscreennotify_fuzzer/sinkproxydscreennotify_fuzzer.cpp @@ -27,7 +27,7 @@ namespace OHOS { namespace DistributedHardware { void DScreenNotifyFuzzTest(const uint8_t* data, size_t size) { - if ((data == nullptr) || (size <= sizeof(int32_t))) { + if ((data == nullptr) || (size < sizeof(int32_t))) { return; } -- Gitee