Don't pad before calling writeInPlace().
writeInplace() itself already pads securely, by masking off the padded bytes. If the padding is done before calling writeInplace(), no mask is applied, and heap data can leak. Bug: 77237570 Test: builds Change-Id: Ide27a0002d4ed4196530430760245b971f6a3f44 Merged-In: Ide27a0002d4ed4196530430760245b971f6a3f44 (cherry picked from commit f8542381b72a7bb2452a5278a00ca8c34edbf8a0) (cherry picked from commit 732132b765cd7b667f16cf32f0fe4c852d7d44dd) Change-Id: Id65e4573e18ab68b804f1cf63a6977a71da01e5d
This commit is contained in:
parent
b2cc7deac7
commit
057269956b
@ -1055,7 +1055,7 @@ status_t Parcel::write(const FlattenableHelperInterface& val)
|
|||||||
if (err) return err;
|
if (err) return err;
|
||||||
|
|
||||||
// payload
|
// payload
|
||||||
void* const buf = this->writeInplace(pad_size(len));
|
void* const buf = this->writeInplace(len);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user