aboutsummaryrefslogtreecommitdiff
path: root/src/alter.c
diff options
context:
space:
mode:
authordrh <>2025-05-19 14:50:36 +0000
committerdrh <>2025-05-19 14:50:36 +0000
commit4a0b7a332f3aeb27814cfa12dc0ebdbbd994a928 (patch)
treeb5dadea28aa1a72312c99f1326b328f57f1ca402 /src/alter.c
parent79c792d5d9b1b9fdd8c1ad9d9a9564b2a2e8d5b3 (diff)
downloadsqlite-master.tar.gz
sqlite-master.zip
Clarify some malloc size computations to simplify the proof that theyHEADmaster
are safe. Remove some code associated with cygwin that is marked "#if 0". FossilOrigin-Name: ba8184d132a935aa1980fbfb61ff308b93d433d559db4968f9014f7653ac9c6e
Diffstat (limited to 'src/alter.c')
-rw-r--r--src/alter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/alter.c b/src/alter.c
index f3108cbf9..a7255e75e 100644
--- a/src/alter.c
+++ b/src/alter.c
@@ -1223,10 +1223,10 @@ static int renameEditSql(
}
assert( nQuot>=nNew && nSql>=0 && nNew>=0 );
- zOut = sqlite3DbMallocZero(db, (u64)(nSql + pRename->nList*nQuot + 1));
+ zOut = sqlite3DbMallocZero(db, (u64)nSql + pRename->nList*(u64)nQuot + 1);
}else{
assert( nSql>0 );
- zOut = (char*)sqlite3DbMallocZero(db, (u64)(nSql*2+1) * 3);
+ zOut = (char*)sqlite3DbMallocZero(db, (2*(u64)nSql + 1) * 3);
if( zOut ){
zBuf1 = &zOut[nSql*2+1];
zBuf2 = &zOut[nSql*4+2];