Skip to content

Commit 13f1db8

Browse files
committed
buffer overrun fix
1 parent 19b4e11 commit 13f1db8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fread.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,8 @@ int freadMain(freadMainArgs _args)
25622562
j + 1, colNames ? " <<" : "", colNames ? (colNames[j].len) : 0, colNames ? (colNamesAnchor + colNames[j].off) : "", colNames ? ">>" : "",
25632563
typeName[IGNORE_BUMP(joldType)], typeName[IGNORE_BUMP(thisType)],
25642564
(int)(tch - fieldStart), fieldStart, (int64_t)(ctx.DTi + myNrow));
2565+
2566+
len = iminInt(len, sizeof(buffer) - 1);
25652567

25662568
typeBumpMsg = realloc(typeBumpMsg, typeBumpMsgSize + len + 1);
25672569
strcpy(typeBumpMsg + typeBumpMsgSize, buffer);

0 commit comments

Comments
 (0)