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: 1b9dea0)
Validate number of steps specified in permutation
2012年1月11日 21:46:18 +0000 (18:46 -0300)
2012年1月11日 21:48:59 +0000 (18:48 -0300)
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.


diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 38f1e78dc5cab7d7d42762fb29b0365565269d0d..1d339e9c577c506c28641a9bbb4dd74ed72fd8dd 100644 (file)
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -395,6 +395,12 @@ run_named_permutations(TestSpec * testspec)
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 */
@@ -404,7 +410,8 @@ run_named_permutations(TestSpec * testspec)
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();
}
}
This is the main PostgreSQL git repository.
RSS Atom

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