Skip to content

Commit

Permalink
Fix a couple of integer overflows when there are LOTS of skip kmers.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Jul 30, 2018
1 parent 14cfa33 commit 27adf7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/overlapInCore/overlapInCore-Build_Hash_Index.C
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Add_Extra_Hash_String(const char *s) {

int len;

uint32 new_len = Used_Data_Len + G.Kmer_Len;
uint64 new_len = Used_Data_Len + G.Kmer_Len;

if (Extra_String_Subcount < MAX_EXTRA_SUBCOUNT) {
sub = String_Ct + Extra_String_Ct - 1;
Expand Down Expand Up @@ -641,7 +641,7 @@ Build_Hash_Index(sqStore *seqStore, uint32 bgnID, uint32 endID) {
//fprintf(stderr, "Extra_Ref_Ct = " F_U64 " Max_Extra_Ref_Space = " F_U64 "\n", Extra_Ref_Ct, Max_Extra_Ref_Space);

if (Extra_Ref_Ct > Max_Extra_Ref_Space) {
int32 newSize = (Max_Extra_Ref_Space == 0) ? 16 * 1024 : Max_Extra_Ref_Space * 2;
int64 newSize = (Max_Extra_Ref_Space == 0) ? 16 * 1024 : Max_Extra_Ref_Space * 2;

while (newSize < Extra_Ref_Ct)
newSize *= 2;
Expand Down

0 comments on commit 27adf7a

Please sign in to comment.