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

Commit fd83ca3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "mtp_packet_fuzzer: Bug fix" into main

parents 71b17f99 49930c9d
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()>>({
                [&]() {