A permutation that specifies more steps than defined causes
isolationtester to crash, so avoid that. Using less steps than defined
should probably not be a problem, but no spec currently does that.
Permutation *p = testspec->permutations[i];
Step **steps;
+ if (p->nsteps != nallsteps)
+ {
+ fprintf(stderr, "invalid number of steps in permutation %d\n", i + 1);
+ exit_nicely();
+ }
+
steps = malloc(p->nsteps * sizeof(Step *));
/* Find all the named steps from the lookup table */
sizeof(Step *), &step_bsearch_cmp));
if (steps[j] == NULL)
{
- fprintf(stderr, "undefined step \"%s\" specified in permutation\n", p->stepnames[j]);
+ fprintf(stderr, "undefined step \"%s\" specified in permutation\n",
+ p->stepnames[j]);
exit_nicely();
}
}