OSDN Git Service

Don't corrupt parcel when writeFileDescriptor() fails
authorChristopher Tate <ctate@google.com>
Thu, 4 Jun 2015 01:44:15 +0000 (18:44 -0700)
committerChristopher Tate <ctate@google.com>
Mon, 8 Jun 2015 20:13:19 +0000 (13:13 -0700)
commit98e67d352b8805a868ca0e7c2be3ea830fb7c338
tree55f0942778666611027851e7d4e302fa86acc211
parentc6f30bdee1f634eb90d68cb76efe935b6535a1e8
Don't corrupt parcel when writeFileDescriptor() fails

We now check for fd-legality before committing binder objects to
the flattened data buffer rather than after.  Previously we would
wind up corrupting the parcel and incurring driver-level errors,
as well as potentially leaking FDs.

Bug 21428802

Change-Id: Ice0d641b3dcc41fb1b8c68ce2e2ebd744c2863a1
libs/binder/Parcel.cpp