Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ca862de authored by Pawan Wagh's avatar Pawan Wagh Committed by Automerger Merge Worker
Browse files

Merge "Adding AIDL fuzzer media metrics service" am: d395e3cc am: 14ce52a2 am: 34814945

parents 02064441 34814945
Loading
Loading
Loading
Loading
+25 −7
Original line number Original line Diff line number Diff line
@@ -27,13 +27,8 @@ package {
    default_applicable_licenses: ["frameworks_av_license"],
    default_applicable_licenses: ["frameworks_av_license"],
}
}


cc_fuzz {
cc_defaults {
    name: "mediametrics_service_fuzzer",
    name: "mediametrics_service_fuzzer_defaults",

    srcs: [
        "mediametrics_service_fuzzer.cpp",
    ],

    static_libs: [
    static_libs: [
        "libmediametrics",
        "libmediametrics",
        "libmediametricsservice",
        "libmediametricsservice",
@@ -78,3 +73,26 @@ cc_fuzz {
        fuzzed_code_usage: "shipped",
        fuzzed_code_usage: "shipped",
    },
    },
}
}

cc_fuzz {
    name: "mediametrics_service_fuzzer",

    srcs: [
        "mediametrics_service_fuzzer.cpp",
    ],
    defaults: [
        "mediametrics_service_fuzzer_defaults",
    ],
}

cc_fuzz {
    name: "mediametrics_aidl_fuzzer",
    srcs: [
        "mediametrics_aidl_fuzzer.cpp",
    ],
    defaults: [
        "service_fuzzer_defaults",
        "fuzzer_disable_leaks",
        "mediametrics_service_fuzzer_defaults",
    ],
}
+28 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * 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 <fuzzbinder/libbinder_driver.h>

#include <mediametricsservice/MediaMetricsService.h>

using ::android::fuzzService;
using ::android::sp;
using ::android::MediaMetricsService;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    auto service = sp<MediaMetricsService>::make();
    fuzzService(service, FuzzedDataProvider(data, size));
    return 0;
}