[RESTRICT AUTOMERGE] Updated CTS test for Android Security b/17769851
Updated the return code to return EXIT_FAILURE when the test exits before hitting the vulnerability
Bug: 17769851
Bug: 72510314
Test: Ran the new testcase on android-8.0.0_r11 with/without patch
Change-Id: I6948de2f445ae13fdff1b98103a6ac12eae212ad
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/poc.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/poc.cpp
index 0239bc1..1843be3 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/poc.cpp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-6616/poc.cpp
@@ -40,27 +40,27 @@
#if _64_BIT
GetExtractorDef getDef = nullptr;
if (argc < 2) {
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
void *libHandle = dlopen(LIBNAME, RTLD_NOW | RTLD_LOCAL);
if (!libHandle) {
libHandle = dlopen(LIBNAME_APEX, RTLD_NOW | RTLD_LOCAL);
if (!libHandle) {
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
}
getDef = (GetExtractorDef)dlsym(libHandle, "GETEXTRACTORDEF");
if (!getDef) {
dlclose(libHandle);
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
sp < DataSource > dataSource = new FileSource(argv[1]);
if (dataSource == nullptr) {
dlclose(libHandle);
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
void *meta = nullptr;
@@ -76,13 +76,13 @@
}
if (!creator) {
dlclose(libHandle);
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
CMediaExtractor *ret = ((CreatorFunc) creator)(dataSource->wrap(), meta);
if (ret == nullptr) {
dlclose(libHandle);
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
if (meta != nullptr && freeMeta != nullptr) {
@@ -94,7 +94,7 @@
MediaTrack* source = mediaExtractorCUnwrapper->getTrack(0);
if (source == nullptr) {
dlclose(libHandle);
- return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
source->start();