1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-29 13:56:47 +03:00

Avoid NULL pointer dereference in isolationtester

This commit is contained in:
Alvaro Herrera 2012-01-14 18:58:49 -03:00
parent 00c5f55061
commit d2a75837cc

View File

@ -406,14 +406,16 @@ run_named_permutations(TestSpec * testspec)
/* Find all the named steps from the lookup table */
for (j = 0; j < p->nsteps; j++)
{
steps[j] = *((Step **) bsearch(p->stepnames[j], allsteps, nallsteps,
sizeof(Step *), &step_bsearch_cmp));
if (steps[j] == NULL)
Step **this = (Step **) bsearch(p->stepnames[j], allsteps,
nallsteps, sizeof(Step *),
&step_bsearch_cmp);
if (this == NULL)
{
fprintf(stderr, "undefined step \"%s\" specified in permutation\n",
p->stepnames[j]);
exit_nicely();
}
steps[j] = *this;
}
run_permutation(testspec, p->nsteps, steps);