Skip to content

Commit 50363c8

Browse files
committed
Validate number of steps specified in permutation
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.
1 parent 1b9dea0 commit 50363c8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/isolation/isolationtester.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,12 @@ run_named_permutations(TestSpec * testspec)
395395
Permutation *p = testspec->permutations[i];
396396
Step **steps;
397397

398+
if (p->nsteps != nallsteps)
399+
{
400+
fprintf(stderr, "invalid number of steps in permutation %d\n", i + 1);
401+
exit_nicely();
402+
}
403+
398404
steps = malloc(p->nsteps * sizeof(Step *));
399405

400406
/* Find all the named steps from the lookup table */
@@ -404,7 +410,8 @@ run_named_permutations(TestSpec * testspec)
404410
sizeof(Step *), &step_bsearch_cmp));
405411
if (steps[j] == NULL)
406412
{
407-
fprintf(stderr, "undefined step \"%s\" specified in permutation\n", p->stepnames[j]);
413+
fprintf(stderr, "undefined step \"%s\" specified in permutation\n",
414+
p->stepnames[j]);
408415
exit_nicely();
409416
}
410417
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy