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

Commit 73e38c9f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "mtp_packet_fuzzer: Bug fix" into main am: fd83ca3f am: 61074fae am:...

Merge "mtp_packet_fuzzer: Bug fix" into main am: fd83ca3f am: 61074fae am: 23ad201c am: 9504ca14

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2489105



Change-Id: Id0e5419d05c5748769d40cab63628fbf8c5ffce2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3c7ad985 9504ca14
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <MtpPacket.h>
#include <MtpPacketFuzzerUtils.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <mtp.h>

using namespace android;

@@ -35,7 +36,8 @@ class MtpPacketFuzzer : MtpPacketFuzzerUtils {
};

void MtpPacketFuzzer::process() {
    MtpPacket mtpPacket(mFdp.ConsumeIntegralInRange<size_t>(kMinSize, kMaxSize)); /*bufferSize*/
    MtpPacket mtpPacket(mFdp.ConsumeIntegralInRange<size_t>(MTP_CONTAINER_HEADER_SIZE,
                                                            kMaxSize)); /*bufferSize*/
    while (mFdp.remaining_bytes() > 0) {
        auto mtpPacketAPI = mFdp.PickValueInArray<const std::function<void()>>({
                [&]() {