Skip to content

Commit

Permalink
ui: Fix bad size check in Fence::unflatten
Browse files Browse the repository at this point in the history
Differs slightly from mnc+ patch: GetFlattenedSize was fixed in mnc.

Test: Boot device, run poc from bug, observe no longer crashes
Bug: 37285689
Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad
(cherry picked from commit 9809602)
  • Loading branch information
chrisforbes authored and android-build-team Robot committed May 24, 2017
1 parent 8afdb00 commit 5fc2df2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/ui/Fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ status_t Fence::unflatten(void const*& buffer, size_t& size, int const*& fds, si
return INVALID_OPERATION;
}

if (size < 1) {
if (size < getFlattenedSize()) {
return NO_MEMORY;
}

Expand Down

0 comments on commit 5fc2df2

Please sign in to comment.