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:
ba1e321
)
Resize object capacity when shrinking Parcel
author
Michael Wachenschwanz
<mwachens@google.com>
Tue, 15 Oct 2019 18:49:22 +0000
(11:49 -0700)
committer
Manjae Park
<manjaepark@google.com>
Mon, 16 Dec 2019 20:39:16 +0000
(12:39 -0800)
Bug:
140419401
Test: atest android.os.cts.ParcelTest
Change-Id: I04edee415e1984ba5fb97c5c1b09892a360cf221
(cherry picked from commit
c67d9f33b36cbb95b121d058f51d6653f1ec4334
)
(cherry picked from commit
d9d10dbdf2f20af3dd01376d2130c71c052e42f3
)
libs/binder/Parcel.cpp
patch
|
blob
|
history
diff --git
a/libs/binder/Parcel.cpp
b/libs/binder/Parcel.cpp
index
59a363f
..
89516bc
100644
(file)
--- a/
libs/binder/Parcel.cpp
+++ b/
libs/binder/Parcel.cpp
@@
-2713,11
+2713,13
@@
status_t Parcel::continueWrite(size_t desired)
if (objectsSize == 0) {
free(mObjects);
mObjects = nullptr;
+ mObjectsCapacity = 0;
} else {
binder_size_t* objects =
(binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t));
if (objects) {
mObjects = objects;
+ mObjectsCapacity = objectsSize;
}
}
mObjectsSize = objectsSize;