Merge "snapuserd: Fix ubsan when reading a single aligned sector." into main am: 89d22239d2 am: 1eb661531e am: 3f70214563 am: 1568605c16

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2666388

Change-Id: Id4869bd1f6f66d04b299158ea384bdd4d3482912
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
David Anderson 2023-07-20 19:12:07 +00:00 committed by Automerger Merge Worker
commit 08a03e7309

View file

@ -305,7 +305,7 @@ bool ReadWorker::ReadAlignedSector(sector_t sector, size_t sz) {
return false;
}
ret = BLOCK_SZ;
ret = std::min(BLOCK_SZ, read_size);
}
read_size -= ret;