summaryrefslogtreecommitdiff
path: root/src/test/isolation/isolationtester.c
diff options
context:
space:
mode:
authorAlvaro Herrera2012-01-14 21:58:49 +0000
committerAlvaro Herrera2012-01-14 22:01:32 +0000
commitd2a75837ccaa3b0da996969674b631dc3f778838 (patch)
treea484d65880963c174b24e2222b49228335e57f38 /src/test/isolation/isolationtester.c
parent00c5f55061df52ccfd82eae16f054e08818ad0ff (diff)
Avoid NULL pointer dereference in isolationtester
Diffstat (limited to 'src/test/isolation/isolationtester.c')
-rw-r--r--src/test/isolation/isolationtester.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 1d339e9c577..b35e533b66c 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -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);