/ Check-in [6cae81cd]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Avoid an "uninitialized value read" problem in fts5 that can occur with a corrupt database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6cae81cd1ffb0180e0260d5ba921502c7dee2f54637bff3558a4d1cb5dfd3f32
User & Date: dan 2018-12-26 16:57:47
Original Comment: Avoid an "unitialized value read" problem in fts5 that can occur with a corrupt database.
Context
2018-12-26
17:49
Add a few more test cases to walvfs.test. check-in: 14a64df3 user: dan tags: trunk
16:57
Avoid an "uninitialized value read" problem in fts5 that can occur with a corrupt database. check-in: 6cae81cd user: dan tags: trunk
16:04
Fix a problem with handling corrupt databases in the fts5 integrity-check function. check-in: 9bad745d user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_index.c.

686
687
688
689
690
691
692
693
694

695
696
697
698
699
700
701
        rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
      }
      if( rc!=SQLITE_OK ){
        sqlite3_free(pRet);
        pRet = 0;
      }else{
        /* TODO1: Fix this */
        pRet->szLeaf = fts5GetU16(&pRet->p[2]);
        pRet->p[nByte] = 0x00;

      }
    }
    p->rc = rc;
    p->nRead++;
  }

  assert( (pRet==0)==(p->rc!=SQLITE_OK) );







<

>







686
687
688
689
690
691
692

693
694
695
696
697
698
699
700
701
        rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
      }
      if( rc!=SQLITE_OK ){
        sqlite3_free(pRet);
        pRet = 0;
      }else{
        /* TODO1: Fix this */

        pRet->p[nByte] = 0x00;
        pRet->szLeaf = fts5GetU16(&pRet->p[2]);
      }
    }
    p->rc = rc;
    p->nRead++;
  }

  assert( (pRet==0)==(p->rc!=SQLITE_OK) );