Skip to content

Commit

Permalink
Merge pull request #784 from taosdata/fix/TD-31537-3.0
Browse files Browse the repository at this point in the history
fix: read csv length over int32 range
  • Loading branch information
DuanKuanJun committed Aug 20, 2024
2 parents e5ea947 + cd8578c commit 64dc129
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/benchData.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ static int generateSampleFromCsv(char *buffer, char* file, FILE* fp, int32_t len
continue;
}

memcpy(buffer + getRows * length, line, readLen + 1);
int64_t offset = ((int64_t)getRows) * length;
memcpy(buffer + offset, line, readLen + 1);
getRows++;

if (getRows == size) {
Expand Down

0 comments on commit 64dc129

Please sign in to comment.