1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

When enlarging the size of a StrAccum object, use sqlite3DbMallocSize() to

record the entire size of the allocation, not just the requested size.

FossilOrigin-Name: 3dda3c937469ce661d1cd0e8d8963a03e698ee39
This commit is contained in:
drh
2014-11-03 13:24:12 +00:00
parent d1dcb23465
commit 7f5a7ecd21
3 changed files with 8 additions and 7 deletions

View File

@@ -786,6 +786,7 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
assert( p->zText!=0 || p->nChar==0 );
if( zOld==0 && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
p->zText = zNew;
p->nAlloc = sqlite3DbMallocSize(p->db, zNew);
}else{
sqlite3StrAccumReset(p);
setStrAccumError(p, STRACCUM_NOMEM);