aboutsummaryrefslogtreecommitdiff
path: root/src/attach.c
diff options
context:
space:
mode:
authordrh <>2025-02-17 17:33:14 +0000
committerdrh <>2025-02-17 17:33:14 +0000
commitef86b942b9ffbfc2086da7865effea3e7950c7a0 (patch)
tree0eac3b56e88b0a79b7055a0627015c21883d7442 /src/attach.c
parentad5dcff53bfb93d0e2ce8165fc2d63f83edd4c79 (diff)
downloadsqlite-ef86b942b9ffbfc2086da7865effea3e7950c7a0.tar.gz
sqlite-ef86b942b9ffbfc2086da7865effea3e7950c7a0.zip
Code changes that make it easier to prove that no 32-bit integer overflows
happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
Diffstat (limited to 'src/attach.c')
-rw-r--r--src/attach.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/attach.c b/src/attach.c
index 399a6cb53..f6c224710 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -156,7 +156,7 @@ static void attachFunc(
if( aNew==0 ) return;
memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2);
}else{
- aNew = sqlite3DbRealloc(db, db->aDb, sizeof(db->aDb[0])*(db->nDb+1) );
+ aNew = sqlite3DbRealloc(db, db->aDb, sizeof(db->aDb[0])*(1+(i64)db->nDb));
if( aNew==0 ) return;
}
db->aDb = aNew;