Merge topic 'coverity-generated-tests'

7eddefd TestDriver.cxx.in: Untrusted array index read.
This commit is contained in:
Brad King 2013-10-18 10:01:46 -04:00 committed by CMake Topic Stage
commit eff13ebf33
1 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,13 @@ int main(int ac, char *av[])
{ {
int result; int result;
@CMAKE_TESTDRIVER_BEFORE_TESTMAIN@ @CMAKE_TESTDRIVER_BEFORE_TESTMAIN@
if (testToRun < 0 || testToRun >= NumTests)
{
printf(
"testToRun was modified by TestDriver code to an invalid value: %3d.\n",
testNum);
return -1;
}
result = (*cmakeGeneratedFunctionMapEntries[testToRun].func)(ac, av); result = (*cmakeGeneratedFunctionMapEntries[testToRun].func)(ac, av);
@CMAKE_TESTDRIVER_AFTER_TESTMAIN@ @CMAKE_TESTDRIVER_AFTER_TESTMAIN@
return result; return result;