Skip to content

Commit 9555b0b

Browse files
author
D. Richard Hipp
committed
Cast a string size variable to 64-bit to avoid any possibility of
integer overflow.
1 parent 55b4e46 commit 9555b0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/printf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
921921
}else{
922922
char *zOld = isMalloced(p) ? p->zText : 0;
923923
i64 szNew = p->nChar;
924-
szNew += N + 1;
924+
szNew += (sqlite3_int64)N + 1;
925925
if( szNew+p->nChar<=p->mxAlloc ){
926926
/* Force exponential buffer size growth as long as it does not overflow,
927927
** to avoid having to call this routine too often */

0 commit comments

Comments
 (0)