summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetsProvider.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2021-05-18 15:45:48 -0700
committerRyan Mitchell <rtmitchell@google.com>2021-05-26 16:01:38 -0700
commitbef47a35776cf1d5ae9124b3a3823d1b950d0b80 (patch)
treee3d73b255ac07182fc8ab374f017b692ff0c6e5c /libs/androidfw/AssetsProvider.cpp
parent72cd5f15528e6b930fadfdef1d79722ea7ff02e7 (diff)
StringBlock incremental hardening default values
When a string cannot be retrieved from a StringBlock due to pages of the StringPool missing, rather than throwing an IndexOutOfBoundsException, compute a default value rather that abides by the API contacts of the functions that use the StringBlock. IndexOutOfBoundsExceptions are not really documented as a possible exception that can be thrown from APIs that use StringBlock because it indicates that the binary resource table was built incorrectly. Returning default values is much less likely to break applications that fetch the resources of incrementally installed applications than throwing IndexOutOfBoundsExceptions where they would normally not be expected. Bug: 188174746 Test: atest ResourcesHardeningTest Change-Id: I58fe754fb446fefc031ddba19e290830fdd6d015
Diffstat (limited to 'libs/androidfw/AssetsProvider.cpp')
0 files changed, 0 insertions, 0 deletions