summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-05-10 13:12:00 -0700
committerTim Schumacher <timschumi2@arcor.de>2017-07-09 03:47:39 +0200
commit03aa3fb43916cacf03416338c090ce55d28af428 (patch)
tree0fc936d9ef4238d5a87139abc497b703dbb14892
parentbd149a6d97e69dcf76320e6bd8cedcea7d038f4c (diff)
downloadandroid_frameworks_native-03aa3fb43916cacf03416338c090ce55d28af428.tar.gz
android_frameworks_native-03aa3fb43916cacf03416338c090ce55d28af428.tar.bz2
android_frameworks_native-03aa3fb43916cacf03416338c090ce55d28af428.zip
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 AOSP-Change-Id: Id8b851733b088cce0d07493fbf76e7e24f9299ad (cherry picked from commit 9809602ac32dcb7bceaa5bc34df5b7fb68aacd38) Change-Id: I82dd3b0504763c9213ca56b33790b7faa17bb9ad
-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 93ec0ce61..f94be35bc 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -152,7 +152,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;
}