OSDN Git Service

[DO NOT MERGE] Check bounds in offsetToPtr
authorFyodor Kupolov <fkupolov@google.com>
Tue, 28 Feb 2017 01:33:18 +0000 (17:33 -0800)
committerFyodor Kupolov <fkupolov@google.com>
Tue, 28 Feb 2017 02:44:08 +0000 (02:44 +0000)
commitacede24109412a4c09e6e4e93d7b96bc9b1ad440
treed68cade5b9e5bf46d2d5512b87243b839fd6cfc3
parenta08c6a1cfbed86da5a9ab5a7838f0318be6c64d0
[DO NOT MERGE] Check bounds in offsetToPtr

Check whether specified offset belongs to mData.
Also added a default argument bufferSize to check the end offset.

Size of the ashmem descriptor can be modified between
ashmem_get_size_region call and mmap. createFromParcel method was updated
to check ashmem size again immediately after memory is mapped.

Test: manual - using the test app from the bug
Bug: 34128677
Change-Id: I3ecd1616a870ce20941ce9b20a1843d2b4295750
(cherry picked from commit 45e2e95c2ffeb2d978e2cce80b729ef6ada3b8d2)
include/androidfw/CursorWindow.h
libs/androidfw/CursorWindow.cpp