git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00c5f55)
Avoid NULL pointer dereference in isolationtester
2012年1月14日 21:58:49 +0000 (18:58 -0300)
2012年1月14日 22:01:32 +0000 (19:01 -0300)

diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 1d339e9c577c506c28641a9bbb4dd74ed72fd8dd..b35e533b66c5143448c03e6748505dc6ed0cbac7 100644 (file)
--- 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);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /