Skip to content

Commit

Permalink
Merge pull request #24 from mbroz/dab-monobit2-ntup
Browse files Browse the repository at this point in the history
Avoid overflow in DAB Monobit2 test.
  • Loading branch information
eddelbuettel authored Apr 6, 2024
2 parents 2d4763a + d928cbf commit 3442896
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libdieharder/dab_monobit2.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ int dab_monobit2(Test **test, int irun)
if ( nsamp*gsl_ran_binomial_pdf(nmax/2,0.5,nmax) < 20 ) break;
}
ntup = j;
} else if (ntup >= BLOCK_MAX) {
fprintf(stderr,"Error: Can only use ntup up to %i.\n", BLOCK_MAX-1);
fprintf(stderr," Read test description with dieharder -d 209 -h.\n");
exit(0);
}

test[0]->ntuple = ntup;
Expand Down

0 comments on commit 3442896

Please sign in to comment.