diff options
author | Chia-I Wu <olv@google.com> | 2018-10-11 16:46:39 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-10-11 16:46:39 -0700 |
commit | e23933651a4ff6995d01b2b29cadfa4733106573 (patch) | |
tree | 7ec9545b168cac2171514822fbd98ce2da5b728c | |
parent | 738966bf16e72ca15d5cd8fcc8a6ba1533082020 (diff) | |
parent | 11ed3dccbd7c60f8a3c04f36a5e86b77e2e6b7e8 (diff) | |
download | native-e23933651a4ff6995d01b2b29cadfa4733106573.tar.gz |
libui: add boundary check to GraphicBuffer::unflatten am: bf8d7210c4
am: 11ed3dccbd
Change-Id: I29e41b7825be1d65aade78e8c536908183112b01
-rw-r--r-- | libs/ui/GraphicBuffer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 254038b0ad..7670ac6fbd 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -377,6 +377,10 @@ status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t& status_t GraphicBuffer::unflatten( void const*& buffer, size_t& size, int const*& fds, size_t& count) { + if (size < 12 * sizeof(int)) { + android_errorWriteLog(0x534e4554, "114223584"); + return NO_MEMORY; + } int const* buf = static_cast<int const*>(buffer); |