Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50363c8

Browse files
committed
Validate number of steps specified in permutation
A permutation that specifies more steps than defined causesisolationtester to crash, so avoid that. Using less steps than definedshould probably not be a problem, but no spec currently does that.
1 parent1b9dea0 commit50363c8

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)

[8]ページ先頭

©2009-2025 Movatter.jp