/ Check-in [ddc3697e]
Login

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

Overview
Comment:When parsing a corrupt record using sqlite3VdbeRecordUnpack(), make sure that the resulting UnpackedRecord object is completely initialized, to avoid (harmless) MSAN warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ddc3697efd61830fad55c6bf7f9115f4a7f53e08838eba5a82e1406c7a721665
User & Date: drh 2019-01-14 13:32:15
Context
2019-01-14
15:09
Fix a problem with querying a corrupt fts3 database. check-in: 65e50706 user: dan tags: trunk
13:32
When parsing a corrupt record using sqlite3VdbeRecordUnpack(), make sure that the resulting UnpackedRecord object is completely initialized, to avoid (harmless) MSAN warnings. check-in: ddc3697e user: drh tags: trunk
11:56
Have fts3 ignore empty sets of parenthesis if built with SQLITE_ENABLE_FTS3_PARENTHESIS. check-in: c93c6b45 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  3814   3814       /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */
  3815   3815       pMem->szMalloc = 0;
  3816   3816       pMem->z = 0;
  3817   3817       d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
  3818   3818       pMem++;
  3819   3819       if( (++u)>=p->nField ) break;
  3820   3820     }
         3821  +  if( d>nKey && u ){
         3822  +    assert( CORRUPT_DB );
         3823  +    /* In a corrupt record entry, the last pMem might have been set up using 
         3824  +    ** uninitialized memory. Overwrite its value with NULL, to prevent
         3825  +    ** warnings from MSAN. */
         3826  +    sqlite3VdbeMemSetNull(pMem-1);
         3827  +  }
  3821   3828     assert( u<=pKeyInfo->nKeyField + 1 );
  3822   3829     p->nField = u;
  3823   3830   }
  3824   3831   
  3825   3832   #ifdef SQLITE_DEBUG
  3826   3833   /*
  3827   3834   ** This function compares two index or table record keys in the same way