/ Check-in [3869aef6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make sure lookaside memory allocations are unusable after they are freed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3869aef6348018f584137f36f6924193a790e52f
User & Date: drh 2012-05-21 16:59:16
Context
2012-05-21
21:26
Merge the nested aggregate query fix (ticket [c2ad16f997ee9c8ed]) unto trunk. check-in: e459c336 user: drh tags: trunk
19:11
Convert the NameContext object from using u8 booleans to using individual bits in a single u8 as its booleans. This change might become a basis for a fix for [c2ad16f997ee9c]. check-in: 72226096 user: drh tags: nested-agg
16:59
Make sure lookaside memory allocations are unusable after they are freed. check-in: 3869aef6 user: drh tags: trunk
12:25
Move some #defines earlier in the file for test_quota.c in order to avoid a use before definition. check-in: fda1ea0b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/malloc.c.

   487    487     if( db ){
   488    488       if( db->pnBytesFreed ){
   489    489         *db->pnBytesFreed += sqlite3DbMallocSize(db, p);
   490    490         return;
   491    491       }
   492    492       if( isLookaside(db, p) ){
   493    493         LookasideSlot *pBuf = (LookasideSlot*)p;
          494  +#if SQLITE_DEBUG
          495  +      /* Trash all content in the buffer being freed */
          496  +      memset(p, 0xaa, db->lookaside.sz);
          497  +#endif
   494    498         pBuf->pNext = db->lookaside.pFree;
   495    499         db->lookaside.pFree = pBuf;
   496    500         db->lookaside.nOut--;
   497    501         return;
   498    502       }
   499    503     }
   500    504     assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );