mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
Do not dereference null pointer for no matching tests (#1191)
When invoking for example
test_c11_atomics test-that-does-not-exist
parseAndCallCommandLineTests() would attempt to dereference
`resultTestList` which is still a null pointer.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
6b36f645b8
commit
dbd3e787fe
@@ -713,7 +713,6 @@ int parseAndCallCommandLineTests(int argc, const char *argv[],
|
|||||||
ret = saveResultsToJson(filename, argv[0], testList,
|
ret = saveResultsToJson(filename, argv[0], testList,
|
||||||
selectedTestList, resultTestList, testNum);
|
selectedTestList, resultTestList, testNum);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (std::any_of(resultTestList, resultTestList + testNum,
|
if (std::any_of(resultTestList, resultTestList + testNum,
|
||||||
[](test_status result) {
|
[](test_status result) {
|
||||||
@@ -728,6 +727,7 @@ int parseAndCallCommandLineTests(int argc, const char *argv[],
|
|||||||
{
|
{
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(selectedTestList);
|
free(selectedTestList);
|
||||||
free(resultTestList);
|
free(resultTestList);
|
||||||
|
|||||||
Reference in New Issue
Block a user