Skip to content

Commit

Permalink
fix horrifying --make-bed biobank-scale overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchang committed Jan 5, 2024
1 parent 3a6cc91 commit 1648606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 2.0/plink2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static const char ver_str[] = "PLINK v2.00a6"
#elif defined(USE_AOCL)
" AMD"
#endif
" (4 Jan 2024)";
" (5 Jan 2024)";
static const char ver_str2[] =
// include leading space if day < 10, so character length stays the same
" "
Expand Down
4 changes: 3 additions & 1 deletion 2.0/plink2_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5305,7 +5305,9 @@ THREAD_FUNC_DECL MakeBedlikeThread(void* raw_arg) {
const uint32_t sample_ct = mcp->sample_ct;
const uint32_t sample_ctl2 = NypCtToWordCt(sample_ct);
const uint32_t sample_ctv2 = NypCtToVecCt(sample_ct);
const uint32_t sample_ct4 = NypCtToByteCt(sample_ct);
// bugfix (5 Jan 2024): (write_idx * sample_ct4) could overflow when
// sample_ct4 was a uint32_t
const uintptr_t sample_ct4 = NypCtToByteCt(sample_ct);
const uint32_t calc_thread_ct = GetThreadCt(arg->sharedp);
const STD_ARRAY_PTR_DECL(AlleleCode, 2, refalt1_select) = mcp->refalt1_select;
const uint32_t x_code = cip->xymt_codes[kChrOffsetX];
Expand Down

0 comments on commit 1648606

Please sign in to comment.