OSDN Git Service
(root)
/
android-x86
/
frameworks-native.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de781bb
)
libui: add boundary check to GraphicBuffer::unflatten
author
Chia-I Wu
<olv@google.com>
Tue, 9 Oct 2018 22:22:46 +0000
(15:22 -0700)
committer
android-build-team Robot
<android-build-team-robot@google.com>
Fri, 19 Oct 2018 16:33:05 +0000
(16:33 +0000)
Commit
cb496acbe593326e8d5d563847067d02b2df40ec
removed the boundary
check by accident.
Bug:
114223584
Test: manual
Change-Id: I057bc02d5807e438530d1a5327c2e02b9d154151
(cherry picked from commit
bf8d7210c4bbbdc875e9695a301cdf9c3b544279
)
libs/ui/GraphicBuffer.cpp
patch
|
blob
|
history
diff --git
a/libs/ui/GraphicBuffer.cpp
b/libs/ui/GraphicBuffer.cpp
index
c880500
..
6235bd6
100644
(file)
--- a/
libs/ui/GraphicBuffer.cpp
+++ b/
libs/ui/GraphicBuffer.cpp
@@
-372,6
+372,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);