From ae9f44fc74a6a16383f751bf148f2f4c8716c7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 17:55:59 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../native_cpp/test/fuzztest/BUILD.gn | 2 + .../BUILD.gn | 82 +++++++++++++++++++ .../corpus/init | 16 ++++ .../project.xml | 25 ++++++ .../sinkservicedump_fuzzer.cpp | 62 ++++++++++++++ .../sinkservicedump_fuzzer.h | 39 +++++++++ .../BUILD.gn | 82 +++++++++++++++++++ .../corpus/init | 16 ++++ .../project.xml | 25 ++++++ .../sinkservicedump_fuzzer.cpp | 62 ++++++++++++++ .../sinkservicedump_fuzzer.h | 39 +++++++++ 11 files changed, 450 insertions(+) create mode 100644 services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn create mode 100644 services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/corpus/init create mode 100644 services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/project.xml create mode 100644 services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp create mode 100644 services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn index fcc2a5f1..23f55ba2 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn @@ -37,6 +37,8 @@ group("fuzztest") { "${services_path}/audiomanager/test/fuzztest/sourceserviceunregisterdistributedhardware_fuzzer:fuzztest", "${services_path}/audiomanager/test/fuzztest/sinkservicedump_fuzzer:fuzztest", "${services_path}/common/test/fuzztest/audiodatasetinit64_fuzzer:fuzztest", + "${services_path}/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer:fuzztest", + "${services_path}/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer:fuzztest", "onremotesinksvrdied_fuzzer:fuzztest", "onremotesourcesvrdied_fuzzer:fuzztest", "sinkhandlerfinishstartsa_fuzzer:fuzztest", diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn new file mode 100644 index 00000000..60d4d416 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2022 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/test.gni") +import("../../../../../distributedaudio.gni") + +##############################fuzztest########################################## +ohos_fuzztest("SinkCtrlTransOnChannelEventFuzzTest") { + module_out_path = "${distributedaudio_fuzz_path}/sinkctrltransonchannelevent_fuzzer" + fuzz_config_file = + "${services_path}/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer" + + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "sinkctrltransonchannelevent_fuzzer.cpp" ] + + include_dirs = [ + "include", + "${audio_client_path}/interface", + "${audio_client_path}/micclient/include", + "${audio_client_path}/spkclient/include", + "${audio_control_path}/controlsink/include", + "${audio_processor_path}/interface", + "${audio_transport_path}/interface", + "${audio_transport_path}/audioctrltransport/include", + "${audio_transport_path}/receiverengine/include", + "${audio_transport_path}/senderengine/include", + "${common_path}/dfx_utils/include", + "${common_path}/include", + "${innerkits_path}/native_cpp/audio_sink/include", + "${innerkits_path}/native_cpp/audio_source/include", + "${services_path}/audiomanager/managersink/include", + "${services_path}/common/audioeventcallback", + "${services_path}/common/audiodata/include", + "${services_path}/common/audioparam", + ] + + deps =[ + "${services_path}/audiomanager/servicesink:distributed_audio_sink", + ] + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"SinkServiceDumpFuzzTest\"", + "LOG_DOMAIN=0xD004130", + ] + + external_deps = [ + "c_utils:utils", + "cJSON:cjson", + "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] + + +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":SinkCtrlTransOnChannelEventFuzzTest" ] +} +############################################################################### diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/corpus/init b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/corpus/init new file mode 100644 index 00000000..8eb5a7d6 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +FUZZ \ No newline at end of file diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/project.xml b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/project.xml new file mode 100644 index 00000000..6e8ad2cf --- /dev/null +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp new file mode 100644 index 00000000..cc472e72 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + #include + #include + + #include "av_trans_message.h" + #include "av_trans_types.h" + + #include + #include "daudio_sink_ctrl_trans.h" + #include "sinkctrltransonchannelevent.h" + + #include "dlfcn.h" + + #include "daudio_constants.h" + #include "daudio_errorcode.h" + #include "daudio_log.h" + #include "daudio_util.h" + +namespace OHOS { +namespace DistributedHardware { +void SinkCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) +{ + if (data == nullptr || size == 0) { + return; + } + std::string devId = "devId"; + std::string sessionName = "sessionName"; + std::string peerSessName = "peerSessName"; + auto sinkCtrlTransCb = std::make_shared(); + auto ctrlTrans = DaudioSinkCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); + FuzzedDataProvider fdp(data, size); + AVTransEvent event; + event.content = fdp.ConsumeRandomLengthString(); + event.peerDevId = fdp.ConsumeRandomLengthString(); + event.type = static_cast(fdp.ConsumeIntegral &message) override + { + (void)message; + } +}; +} +} +#endif \ No newline at end of file diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn new file mode 100644 index 00000000..e5d21f16 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2022 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/test.gni") +import("../../../../../distributedaudio.gni") + +##############################fuzztest########################################## +ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { + module_out_path = "${distributedaudio_fuzz_path}/sourcectrltransonchannelevent_fuzzer" + fuzz_config_file = + "${services_path}/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer" + + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "sourcectrltransonchannelevent_fuzzer.cpp" ] + + include_dirs = [ + "include", + "${audio_client_path}/interface", + "${audio_client_path}/micclient/include", + "${audio_client_path}/spkclient/include", + "${audio_control_path}/controlsink/include", + "${audio_processor_path}/interface", + "${audio_transport_path}/interface", + "${audio_transport_path}/audioctrltransport/include", + "${audio_transport_path}/receiverengine/include", + "${audio_transport_path}/senderengine/include", + "${common_path}/dfx_utils/include", + "${common_path}/include", + "${innerkits_path}/native_cpp/audio_sink/include", + "${innerkits_path}/native_cpp/audio_source/include", + "${services_path}/audiomanager/managersink/include", + "${services_path}/common/audioeventcallback", + "${services_path}/common/audiodata/include", + "${services_path}/common/audioparam", + ] + + deps =[ + "${services_path}/audiomanager/servicesink:distributed_audio_sink", + ] + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"SinkServiceDumpFuzzTest\"", + "LOG_DOMAIN=0xD004130", + ] + + external_deps = [ + "c_utils:utils", + "cJSON:cjson", + "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] + + +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":SourceCtrlTransOnChannelEventFuzzTest" ] +} +############################################################################### diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init new file mode 100644 index 00000000..8eb5a7d6 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +FUZZ \ No newline at end of file diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml new file mode 100644 index 00000000..6e8ad2cf --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp new file mode 100644 index 00000000..3aa0f656 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + #include + #include + + #include "av_trans_message.h" + #include "av_trans_types.h" + + #include + #include "daudio_sink_ctrl_trans.h" + #include "sourcectrltransonchannelevent.h" + + #include "dlfcn.h" + + #include "daudio_constants.h" + #include "daudio_errorcode.h" + #include "daudio_log.h" + #include "daudio_util.h" + +namespace OHOS { +namespace DistributedHardware { +void SourceCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) +{ + if (data == nullptr || size == 0) { + return; + } + std::string devId = "devId"; + std::string sessionName = "sessionName"; + std::string peerSessName = "peerSessName"; + auto sinkCtrlTransCb = std::make_shared(); + auto ctrlTrans = DaudioSourceCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); + FuzzedDataProvider fdp(data, size); + AVTransEvent event; + event.content = fdp.ConsumeRandomLengthString(); + event.peerDevId = fdp.ConsumeRandomLengthString(); + event.type = static_cast(fdp.ConsumeIntegral &message) override + { + (void)message; + } +}; +} +} +#endif \ No newline at end of file -- Gitee From 909df799b9f09408f11f7e4f5d40d7ed75f13b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 18:50:14 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- ...=> sinkctrltransonchannelevent_fuzzer.cpp} | 24 +++++++++---------- ...h => sinkctrltransonchannelevent_fuzzer.h} | 0 ... sourcectrltransonchannelevent_fuzzer.cpp} | 24 +++++++++---------- ...=> sourcectrltransonchannelevent_fuzzer.h} | 0 4 files changed, 24 insertions(+), 24 deletions(-) rename services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/{sinkservicedump_fuzzer.cpp => sinkctrltransonchannelevent_fuzzer.cpp} (82%) rename services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/{sinkservicedump_fuzzer.h => sinkctrltransonchannelevent_fuzzer.h} (100%) rename services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/{sinkservicedump_fuzzer.cpp => sourcectrltransonchannelevent_fuzzer.cpp} (82%) rename services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/{sinkservicedump_fuzzer.h => sourcectrltransonchannelevent_fuzzer.h} (100%) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp similarity index 82% rename from services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp rename to services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index cc472e72..fcd77cba 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -13,22 +13,22 @@ * limitations under the License. */ - #include - #include +#include +#include - #include "av_trans_message.h" - #include "av_trans_types.h" +#include "av_trans_message.h" +#include "av_trans_types.h" - #include - #include "daudio_sink_ctrl_trans.h" - #include "sinkctrltransonchannelevent.h" +#include +#include "daudio_sink_ctrl_trans.h" +#include "sinkctrltransonchannelevent.h" - #include "dlfcn.h" +#include "dlfcn.h" - #include "daudio_constants.h" - #include "daudio_errorcode.h" - #include "daudio_log.h" - #include "daudio_util.h" +#include "daudio_constants.h" +#include "daudio_errorcode.h" +#include "daudio_log.h" +#include "daudio_util.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.h similarity index 100% rename from services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h rename to services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.h diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp similarity index 82% rename from services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp rename to services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 3aa0f656..ff6146a6 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -13,22 +13,22 @@ * limitations under the License. */ - #include - #include +#include +#include - #include "av_trans_message.h" - #include "av_trans_types.h" +#include "av_trans_message.h" +#include "av_trans_types.h" - #include - #include "daudio_sink_ctrl_trans.h" - #include "sourcectrltransonchannelevent.h" +#include +#include "daudio_sink_ctrl_trans.h" +#include "sourcectrltransonchannelevent.h" - #include "dlfcn.h" +#include "dlfcn.h" - #include "daudio_constants.h" - #include "daudio_errorcode.h" - #include "daudio_log.h" - #include "daudio_util.h" +#include "daudio_constants.h" +#include "daudio_errorcode.h" +#include "daudio_log.h" +#include "daudio_util.h" namespace OHOS { namespace DistributedHardware { diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h similarity index 100% rename from services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sinkservicedump_fuzzer.h rename to services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h -- Gitee From 5dd594cea3940b174a8bc21b99198a45494005a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 19:14:46 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../sinkctrltransonchannelevent_fuzzer.cpp | 2 +- .../sourcectrltransonchannelevent_fuzzer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index fcd77cba..9f3a7aa4 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -23,7 +23,7 @@ #include "daudio_sink_ctrl_trans.h" #include "sinkctrltransonchannelevent.h" -#include "dlfcn.h" +#include #include "daudio_constants.h" #include "daudio_errorcode.h" diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index ff6146a6..69281848 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -23,7 +23,7 @@ #include "daudio_sink_ctrl_trans.h" #include "sourcectrltransonchannelevent.h" -#include "dlfcn.h" +#include #include "daudio_constants.h" #include "daudio_errorcode.h" -- Gitee From e58d2fb8529fdb4eb4d82d08486ebdfb2da4a264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 19:58:02 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn | 8 ++++---- .../sinkctrltransonchannelevent_fuzzer.cpp | 2 +- .../sourcectrltransonchannelevent_fuzzer/BUILD.gn | 8 ++++---- .../sourcectrltransonchannelevent_fuzzer.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn index 60d4d416..410fd109 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn @@ -51,13 +51,13 @@ ohos_fuzztest("SinkCtrlTransOnChannelEventFuzzTest") { "${services_path}/common/audioparam", ] - deps =[ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - ] + deps = [ + "${services_path}/audiomanager/servicesink:distributed_audio_sink", + ] defines = [ "HI_LOG_ENABLE", - "DH_LOG_TAG=\"SinkServiceDumpFuzzTest\"", + "DH_LOG_TAG=\"SinkCtrlTransOnChannelEventFuzzTest\"", "LOG_DOMAIN=0xD004130", ] diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index 9f3a7aa4..ce6ee83b 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -21,7 +21,7 @@ #include #include "daudio_sink_ctrl_trans.h" -#include "sinkctrltransonchannelevent.h" +#include "sinkctrltransonchannelevent_fuzzer.h" #include diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn index e5d21f16..fa78829b 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -51,13 +51,13 @@ ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { "${services_path}/common/audioparam", ] - deps =[ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - ] + deps = [ + "${services_path}/audiomanager/servicesink:distributed_audio_sink", + ] defines = [ "HI_LOG_ENABLE", - "DH_LOG_TAG=\"SinkServiceDumpFuzzTest\"", + "DH_LOG_TAG=\"SourceCtrlTransOnChannelEventFuzzTest\"", "LOG_DOMAIN=0xD004130", ] diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 69281848..1ef86632 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -21,7 +21,7 @@ #include #include "daudio_sink_ctrl_trans.h" -#include "sourcectrltransonchannelevent.h" +#include "sourcectrltransonchannelevent_fuzzer.h" #include -- Gitee From f421f52b3c8c47fb177aa9f1c3657cabc4aaae51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 20:42:26 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn | 2 +- .../sourcectrltransonchannelevent_fuzzer.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn index fa78829b..b08a5722 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -52,7 +52,7 @@ ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { ] deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", + "${services_path}/audiomanager/servicesource:distributed_audio_source", ] defines = [ diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h index e7499784..0833bc73 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h @@ -13,8 +13,8 @@ * limitations under the License. */ -#ifndef SINKCTRLTRANSONCHANNELEVENT_FUZZER_H -#define SINKCTRLTRANSONCHANNELEVENT_FUZZER_H +#ifndef SOURCECTRLTRANSONCHANNELEVENT_FUZZER_H +#define SOURCECTRLTRANSONCHANNELEVENT_FUZZER_H #define FUZZ_PROJECT_NAME "sourcectrltransonchannelevent_fuzzer" #include "iaudio_ctrltrans_callback.h" -- Gitee From 9b19c1aba400f1b4b3bfee578a5cc4c166a9b8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 20:46:13 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn index b08a5722..36461c16 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -52,12 +52,12 @@ ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { ] deps = [ - "${services_path}/audiomanager/servicesource:distributed_audio_source", + "${services_path}/audiomanager/servicesink:distributed_audio_sink", ] defines = [ "HI_LOG_ENABLE", - "DH_LOG_TAG=\"SourceCtrlTransOnChannelEventFuzzTest\"", + "DH_LOG_TAG=\"SourceCtrlTransOnChannelFuzzTest\"", "LOG_DOMAIN=0xD004130", ] -- Gitee From 1196312253ed400a1931617c5a7123b9e33ff818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 20:48:42 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn index 36461c16..fa78829b 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -57,7 +57,7 @@ ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { defines = [ "HI_LOG_ENABLE", - "DH_LOG_TAG=\"SourceCtrlTransOnChannelFuzzTest\"", + "DH_LOG_TAG=\"SourceCtrlTransOnChannelEventFuzzTest\"", "LOG_DOMAIN=0xD004130", ] -- Gitee From 07d4e2ffce0bb35e20d4446f5ec858b85380f41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 21:26:24 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../sinkctrltransonchannelevent_fuzzer.cpp | 1 + .../sourcectrltransonchannelevent_fuzzer.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index ce6ee83b..1a47b224 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -22,6 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sinkctrltransonchannelevent_fuzzer.h" +#include "transport/socket.h" #include diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 1ef86632..8fc798a5 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -22,6 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sourcectrltransonchannelevent_fuzzer.h" +#include "transport/socket.h" #include -- Gitee From 7920c7580e62503a0146539d9ae91cb18ae79498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 22:00:10 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../sinkctrltransonchannelevent_fuzzer.cpp | 1 - .../sourcectrltransonchannelevent_fuzzer.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index 1a47b224..ce6ee83b 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -22,7 +22,6 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sinkctrltransonchannelevent_fuzzer.h" -#include "transport/socket.h" #include diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 8fc798a5..22509d77 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -22,7 +22,6 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sourcectrltransonchannelevent_fuzzer.h" -#include "transport/socket.h" #include @@ -42,7 +41,7 @@ void SourceCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) std::string sessionName = "sessionName"; std::string peerSessName = "peerSessName"; auto sinkCtrlTransCb = std::make_shared(); - auto ctrlTrans = DaudioSourceCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); + auto ctrlTrans = DaudioSinkCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); FuzzedDataProvider fdp(data, size); AVTransEvent event; event.content = fdp.ConsumeRandomLengthString(); -- Gitee From 8f955b8fd19fe05561c0fc40700802942e0e94e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Tue, 1 Jul 2025 22:20:06 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../BUILD.gn | 82 ------------------- .../corpus/init | 16 ---- .../project.xml | 25 ------ .../sourcectrltransonchannelevent_fuzzer.cpp | 62 -------------- .../sourcectrltransonchannelevent_fuzzer.h | 39 --------- 5 files changed, 224 deletions(-) delete mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn delete mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init delete mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml delete mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp delete mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn deleted file mode 100644 index fa78829b..00000000 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2022 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#####################hydra-fuzz################### -import("//build/config/features.gni") -import("//build/test.gni") -import("../../../../../distributedaudio.gni") - -##############################fuzztest########################################## -ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { - module_out_path = "${distributedaudio_fuzz_path}/sourcectrltransonchannelevent_fuzzer" - fuzz_config_file = - "${services_path}/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer" - - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - sources = [ "sourcectrltransonchannelevent_fuzzer.cpp" ] - - include_dirs = [ - "include", - "${audio_client_path}/interface", - "${audio_client_path}/micclient/include", - "${audio_client_path}/spkclient/include", - "${audio_control_path}/controlsink/include", - "${audio_processor_path}/interface", - "${audio_transport_path}/interface", - "${audio_transport_path}/audioctrltransport/include", - "${audio_transport_path}/receiverengine/include", - "${audio_transport_path}/senderengine/include", - "${common_path}/dfx_utils/include", - "${common_path}/include", - "${innerkits_path}/native_cpp/audio_sink/include", - "${innerkits_path}/native_cpp/audio_source/include", - "${services_path}/audiomanager/managersink/include", - "${services_path}/common/audioeventcallback", - "${services_path}/common/audiodata/include", - "${services_path}/common/audioparam", - ] - - deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - ] - - defines = [ - "HI_LOG_ENABLE", - "DH_LOG_TAG=\"SourceCtrlTransOnChannelEventFuzzTest\"", - "LOG_DOMAIN=0xD004130", - ] - - external_deps = [ - "c_utils:utils", - "cJSON:cjson", - "distributed_hardware_fwk:distributed_av_sender", - "distributed_hardware_fwk:distributedhardwareutils", - "ipc:ipc_core", - "safwk:system_ability_fwk", - "samgr:samgr_proxy", - ] - - -} - -############################################################################### -group("fuzztest") { - testonly = true - deps = [ ":SourceCtrlTransOnChannelEventFuzzTest" ] -} -############################################################################### diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init deleted file mode 100644 index 8eb5a7d6..00000000 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2022 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -FUZZ \ No newline at end of file diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml deleted file mode 100644 index 6e8ad2cf..00000000 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp deleted file mode 100644 index 22509d77..00000000 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2022 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "av_trans_message.h" -#include "av_trans_types.h" - -#include -#include "daudio_sink_ctrl_trans.h" -#include "sourcectrltransonchannelevent_fuzzer.h" - -#include - -#include "daudio_constants.h" -#include "daudio_errorcode.h" -#include "daudio_log.h" -#include "daudio_util.h" - -namespace OHOS { -namespace DistributedHardware { -void SourceCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) -{ - if (data == nullptr || size == 0) { - return; - } - std::string devId = "devId"; - std::string sessionName = "sessionName"; - std::string peerSessName = "peerSessName"; - auto sinkCtrlTransCb = std::make_shared(); - auto ctrlTrans = DaudioSinkCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); - FuzzedDataProvider fdp(data, size); - AVTransEvent event; - event.content = fdp.ConsumeRandomLengthString(); - event.peerDevId = fdp.ConsumeRandomLengthString(); - event.type = static_cast(fdp.ConsumeIntegral &message) override - { - (void)message; - } -}; -} -} -#endif \ No newline at end of file -- Gitee From 93eb19930f3813e11cc5e7b0850de451786ec0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Wed, 2 Jul 2025 09:34:05 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn index 23f55ba2..9c6060da 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/BUILD.gn @@ -38,7 +38,6 @@ group("fuzztest") { "${services_path}/audiomanager/test/fuzztest/sinkservicedump_fuzzer:fuzztest", "${services_path}/common/test/fuzztest/audiodatasetinit64_fuzzer:fuzztest", "${services_path}/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer:fuzztest", - "${services_path}/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer:fuzztest", "onremotesinksvrdied_fuzzer:fuzztest", "onremotesourcesvrdied_fuzzer:fuzztest", "sinkhandlerfinishstartsa_fuzzer:fuzztest", -- Gitee From eb71d8e2530a9eabd313122f328af5cfe7bbc19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Wed, 2 Jul 2025 10:55:43 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../BUILD.gn | 25 ++++ .../BUILD.gn | 107 ++++++++++++++++++ .../corpus/init | 16 +++ .../project.xml | 25 ++++ .../sourcectrltransonchannelevent_fuzzer.cpp | 62 ++++++++++ .../sourcectrltransonchannelevent_fuzzer.h | 39 +++++++ 6 files changed, 274 insertions(+) create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp create mode 100644 services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.h diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn index 410fd109..def4c4d4 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/BUILD.gn @@ -69,6 +69,31 @@ ohos_fuzztest("SinkCtrlTransOnChannelEventFuzzTest") { "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "access_token:libaccesstoken_sdk", + "access_token:libtokenid_sdk", + "access_token:libtokensetproc_shared", + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", + "cJSON:cjson", + "c_utils:utils", + "device_manager:devicemanagersdk", + "distributed_hardware_fwk:distributed_av_receiver", + "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "distributed_hardware_fwk:libdhfwk_sdk", + "dsoftbus:softbus_client", + "eventhandler:libeventhandler", + "hdf_core:libhdf_ipc_adapter", + "hdf_core:libhdi", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "os_account:libaccountkits", + "os_account:os_account_innerkits", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", ] diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn new file mode 100644 index 00000000..ef486278 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/BUILD.gn @@ -0,0 +1,107 @@ +# Copyright (c) 2022 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#####################hydra-fuzz################### +import("//build/config/features.gni") +import("//build/test.gni") +import("../../../../../distributedaudio.gni") + +##############################fuzztest########################################## +ohos_fuzztest("SourceCtrlTransOnChannelEventFuzzTest") { + module_out_path = "${distributedaudio_fuzz_path}/sourcectrltransonchannelevent_fuzzer" + fuzz_config_file = + "${services_path}/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer" + + cflags = [ + "-g", + "-O0", + "-Wno-unused-variable", + "-fno-omit-frame-pointer", + ] + sources = [ "sourcectrltransonchannelevent_fuzzer.cpp" ] + + include_dirs = [ + "include", + "${audio_client_path}/interface", + "${audio_client_path}/micclient/include", + "${audio_client_path}/spkclient/include", + "${audio_control_path}/controlsink/include", + "${audio_processor_path}/interface", + "${audio_transport_path}/interface", + "${audio_transport_path}/audioctrltransport/include", + "${audio_transport_path}/receiverengine/include", + "${audio_transport_path}/senderengine/include", + "${common_path}/dfx_utils/include", + "${common_path}/include", + "${innerkits_path}/native_cpp/audio_sink/include", + "${innerkits_path}/native_cpp/audio_source/include", + "${services_path}/audiomanager/managersink/include", + "${services_path}/common/audioeventcallback", + "${services_path}/common/audiodata/include", + "${services_path}/common/audioparam", + ] + + deps = [ + "${services_path}/audiomanager/servicesink:distributed_audio_sink", + ] + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"SourceCtrlTransOnChannelEventFuzzTest\"", + "LOG_DOMAIN=0xD004130", + ] + + external_deps = [ + "c_utils:utils", + "cJSON:cjson", + "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + "access_token:libaccesstoken_sdk", + "access_token:libtokenid_sdk", + "access_token:libtokensetproc_shared", + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", + "cJSON:cjson", + "c_utils:utils", + "device_manager:devicemanagersdk", + "distributed_hardware_fwk:distributed_av_receiver", + "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "distributed_hardware_fwk:libdhfwk_sdk", + "dsoftbus:softbus_client", + "eventhandler:libeventhandler", + "hdf_core:libhdf_ipc_adapter", + "hdf_core:libhdi", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "os_account:libaccountkits", + "os_account:os_account_innerkits", + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] + + +} + +############################################################################### +group("fuzztest") { + testonly = true + deps = [ ":SourceCtrlTransOnChannelEventFuzzTest" ] +} +############################################################################### diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init new file mode 100644 index 00000000..8eb5a7d6 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/corpus/init @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +FUZZ \ No newline at end of file diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml new file mode 100644 index 00000000..6e8ad2cf --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/project.xml @@ -0,0 +1,25 @@ + + + + + + 1000 + + 300 + + 4096 + + diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp new file mode 100644 index 00000000..22509d77 --- /dev/null +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "av_trans_message.h" +#include "av_trans_types.h" + +#include +#include "daudio_sink_ctrl_trans.h" +#include "sourcectrltransonchannelevent_fuzzer.h" + +#include + +#include "daudio_constants.h" +#include "daudio_errorcode.h" +#include "daudio_log.h" +#include "daudio_util.h" + +namespace OHOS { +namespace DistributedHardware { +void SourceCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) +{ + if (data == nullptr || size == 0) { + return; + } + std::string devId = "devId"; + std::string sessionName = "sessionName"; + std::string peerSessName = "peerSessName"; + auto sinkCtrlTransCb = std::make_shared(); + auto ctrlTrans = DaudioSinkCtrlTrans(devId, sessionName, peerSessName, sinkCtrlTransCb); + FuzzedDataProvider fdp(data, size); + AVTransEvent event; + event.content = fdp.ConsumeRandomLengthString(); + event.peerDevId = fdp.ConsumeRandomLengthString(); + event.type = static_cast(fdp.ConsumeIntegral &message) override + { + (void)message; + } +}; +} +} +#endif \ No newline at end of file -- Gitee From c8fb39c936208720c9992de3d5dfbc9568108c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Wed, 2 Jul 2025 10:57:17 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../sinkctrltransonchannelevent_fuzzer.cpp | 1 + .../sourcectrltransonchannelevent_fuzzer.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index ce6ee83b..a1d0bff3 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -22,6 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sinkctrltransonchannelevent_fuzzer.h" +#include "transport/socket.h #include diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 22509d77..460fbfd1 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -22,6 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sourcectrltransonchannelevent_fuzzer.h" +#include "transport/socket.h #include -- Gitee From e753de88eda0fe0929d365d8d1c913c0dd63987f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E4=BF=8A=E6=A1=A6?= Date: Wed, 2 Jul 2025 11:20:08 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E7=A9=BA=E5=8F=A3=E6=95=B0=E6=8D=AEfuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯俊桦 --- .../sinkctrltransonchannelevent_fuzzer.cpp | 4 ++-- .../sourcectrltransonchannelevent_fuzzer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp index a1d0bff3..238ab419 100644 --- a/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sinkctrltransonchannelevent_fuzzer/sinkctrltransonchannelevent_fuzzer.cpp @@ -22,7 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sinkctrltransonchannelevent_fuzzer.h" -#include "transport/socket.h +#include "transport/socket.h" #include @@ -47,7 +47,7 @@ void SinkCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) AVTransEvent event; event.content = fdp.ConsumeRandomLengthString(); event.peerDevId = fdp.ConsumeRandomLengthString(); - event.type = static_cast(fdp.ConsumeIntegral(fdp.ConsumeIntegral()); ctrlTrans.OnChannelEvent(event); } } diff --git a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp index 460fbfd1..36f1a20d 100644 --- a/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp +++ b/services/audiotransport/test/fuzztest/sourcectrltransonchannelevent_fuzzer/sourcectrltransonchannelevent_fuzzer.cpp @@ -22,7 +22,7 @@ #include #include "daudio_sink_ctrl_trans.h" #include "sourcectrltransonchannelevent_fuzzer.h" -#include "transport/socket.h +#include "transport/socket.h" #include @@ -47,7 +47,7 @@ void SourceCtrlTransOnChannelEventFuzzTest(const uint8_t* data, size_t size) AVTransEvent event; event.content = fdp.ConsumeRandomLengthString(); event.peerDevId = fdp.ConsumeRandomLengthString(); - event.type = static_cast(fdp.ConsumeIntegral(fdp.ConsumeIntegral()); ctrlTrans.OnChannelEvent(event); } } -- Gitee