Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d2a7583

Browse files
committed
Avoid NULL pointer dereference in isolationtester
1 parent 00c5f55 commit d2a7583

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/isolation/isolationtester.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,16 @@ run_named_permutations(TestSpec * testspec)
406406
/* Find all the named steps from the lookup table */
407407
for (j = 0; j < p->nsteps; j++)
408408
{
409-
steps[j] = *((Step **) bsearch(p->stepnames[j], allsteps, nallsteps,
410-
sizeof(Step *), &step_bsearch_cmp));
411-
if (steps[j] == NULL)
409+
Step **this = (Step **) bsearch(p->stepnames[j], allsteps,
410+
nallsteps, sizeof(Step *),
411+
&step_bsearch_cmp);
412+
if (this == NULL)
412413
{
413414
fprintf(stderr, "undefined step \"%s\" specified in permutation\n",
414415
p->stepnames[j]);
415416
exit_nicely();
416417
}
418+
steps[j] = *this;
417419
}
418420

419421
run_permutation(testspec, p->nsteps, steps);

0 commit comments

Comments
 (0)