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

Commit f5f0b4b9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "inputflinger_blocking_queue_fuzzer: Bug Fix" into main

parents 9fd26868 a9d6f894
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -50,8 +50,9 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
                    // Pops blocks if it is empty, so only pop up to num elements inserted.
                    size_t numPops = fdp.ConsumeIntegralInRange<size_t>(0, filled);
                    for (size_t i = 0; i < numPops; i++) {
                        queue.popWithTimeout(
                                std::chrono::nanoseconds{fdp.ConsumeIntegral<int64_t>()});
                        // Provide a random timeout up to 1 second
                        queue.popWithTimeout(std::chrono::nanoseconds(
                                fdp.ConsumeIntegralInRange<int64_t>(0, 1E9)));
                    }
                    filled > numPops ? filled -= numPops : filled = 0;
                },