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

Commit 2c331aa9 authored by Ivan Lozano's avatar Ivan Lozano Committed by android-build-merger
Browse files

Merge "Fix overflow sanitizer in copyWithAuthor." am: 18977849

am: f99ca332

Change-Id: If60836fda4e1e2214f8cb664079b23c9189a4a02
parents 8ca24ea1 f99ca332
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -331,7 +331,8 @@ NBLog::EntryIterator NBLog::HistogramEntry::copyWithAuthor(
    *(int*) (buffer + sizeof(entry) + sizeof(HistTsEntry)) = author;
    // Update lengths
    buffer[offsetof(entry, length)] = sizeof(HistTsEntryWithAuthor);
    buffer[sizeof(buffer) + Entry::kPreviousLengthOffset] = sizeof(HistTsEntryWithAuthor);
    buffer[offsetof(entry, data) + sizeof(HistTsEntryWithAuthor) + offsetof(ending, length)]
        = sizeof(HistTsEntryWithAuthor);
    // Write new buffer into FIFO
    dst->write(buffer, sizeof(buffer));
    return EntryIterator(mEntry).next();