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

Commit 3bfc6d87 authored by Chris Manton's avatar Chris Manton
Browse files

fuzz: Properly check 64 bit overflow fake_timerfd

Bug: 224114025
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I3252a75b15fc9369af69f8c48b25e8852904d99d
parent 844e9816
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ static bool fire_next_event(uint64_t new_clock) {

void fake_timerfd_advance(uint64_t ms) {
  uint64_t new_clock = clock + ms;
  if (new_clock > max_clock) {
  if (new_clock < clock) {
    new_clock = max_clock;
  }
  while (fire_next_event(new_clock)) {
+5 −1
Original line number Diff line number Diff line
@@ -77,7 +77,11 @@ void Alarm::on_fire() {
  lock.unlock();
  std::move(task).Run();
  ASSERT(bytes_read == static_cast<ssize_t>(sizeof(uint64_t)));
  ASSERT(times_invoked == static_cast<uint64_t>(1));
  ASSERT_LOG(
      times_invoked == static_cast<uint64_t>(1),
      "Invoked number of times:%lu fd:%d",
      (unsigned long)times_invoked,
      fd_);
}

}  // namespace os