commit | 042bdf303ade81bd9f27af86e755c5d3bc2515eb | [log] [tgz] |
---|---|---|
author | Leon Scroggins III <scroggo@google.com> | Thu Sep 28 13:28:55 2017 -0400 |
committer | Leon Scroggins <scroggo@google.com> | Mon Oct 02 15:30:54 2017 +0000 |
tree | a1d06c96b5e63a3619755c24df64d5325aa40eb8 | |
parent | 760a2874141a8718d1acb6b1074f1a62968a07d3 [diff] |
Add a test for invalid webp file Bug: 65290323 Test: This Prior to the fix, attempting to decode this image would read uninitialized memory and write to arbitrary memory. The new image is a modified (truncated) version of webp_test.webp. Merged-In: Ibb1d4aaba5deba0101b2722259c5f856f1645f1a Change-Id: Ibb1d4aaba5deba0101b2722259c5f856f1645f1a
diff --git a/tests/tests/security/res/raw/b65290323.webp b/tests/tests/security/res/raw/b65290323.webp new file mode 100644 index 0000000..e4671bb --- /dev/null +++ b/tests/tests/security/res/raw/b65290323.webp Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/BitmapFactoryDecodeStreamTest.java b/tests/tests/security/src/android/security/cts/BitmapFactoryDecodeStreamTest.java index f36229e7..8c5050c 100644 --- a/tests/tests/security/src/android/security/cts/BitmapFactoryDecodeStreamTest.java +++ b/tests/tests/security/src/android/security/cts/BitmapFactoryDecodeStreamTest.java
@@ -46,4 +46,10 @@ R.raw.cve_2017_0691)); BitmapFactory.decodeStream(exploitImage); } + + public void test_b65290323() throws Exception { + InputStream exploitImage = new BufferedInputStream(mContext.getResources().openRawResource( + R.raw.b65290323)); + BitmapFactory.decodeStream(exploitImage); + } }