summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-05-10 13:12:00 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-05-25 17:45:56 +0000
commitc2f2750eb6d2162b39b4b646336fa56518fdae61 (patch)
tree2a54b3b5f268b14e67d7e1d0291b63e028bd561a
parente3fd69ce6c4b97cd835d20d96fa3d1cc34f1d088 (diff)
downloadnative-c2f2750eb6d2162b39b4b646336fa56518fdae61.tar.gz
ui: Fix bad size check in Fence::unflatten
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 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38)
-rw-r--r--libs/ui/Fence.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp
index bf24ffb7e0..1b2f34dfa8 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -157,7 +157,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;
}