Commit 0404910b authored by Daniel Xie's avatar Daniel Xie Committed by Gerrit Code Review
Browse files

Merge "DO NOT MERGE: CTS test case for verifying overflow in libskia JPG...

Merge "DO NOT MERGE: CTS test case for verifying overflow in libskia JPG processing" into lollipop-cts-dev
parents 15fe61b7 c20900ab
......@@ -34,6 +34,14 @@
<service android:name="android.security.cts.activity.SecureRandomService"
android:process=":secureRandom"/>
<activity
android:name="android.security.cts.SkiaJpegDecodingActivity"
android:label="Test overflow in libskia JPG processing">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST"/>
</intent-filter>
</activity>
</application>
<instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
......
tests/tests/security/res/drawable/signal_sigsegv_in_jmem_ashmem.jpg

4.61 KB

<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/signal_sigsegv_in_jmem_ashmem"
/>
</LinearLayout>
\ No newline at end of file
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.security.cts;
import android.app.Activity;
import android.os.Bundle;
import com.android.cts.security.R;
public class SkiaJpegDecodingActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_skiajpegdecoding);
}
}
\ No newline at end of file
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.security.cts;
import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
public class SkiaJpegDecodingTest extends
ActivityInstrumentationTestCase2<SkiaJpegDecodingActivity> {
private Activity mActivity;
public SkiaJpegDecodingTest() {
super(SkiaJpegDecodingActivity.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
mActivity = getActivity();
assertNotNull("Failed to get the activity instance", mActivity);
}
public void testLibskiaOverFlowJpegProcessing() {
/**
* This is an empty test case. The activity attached with this class
* loads a corrupt JPEG Image on an ImageView. On a patched device
* this will work but on an unpatched device it will crash.
*/
}
@Override
protected void tearDown() throws Exception {
if (mActivity != null) {
mActivity.finish();
}
super.tearDown();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment