/ Check-in [1fb76c3e]
Login

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

Overview
Comment:Avoid attempting to read 0 bytes from a file in the osinst vtab code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | osinst
Files: files | file ages | folders
SHA3-256: 1fb76c3e7d904cd2754270997d3d0c86237b0a630d6b1417578a8191e6e1687f
User & Date: dan 2019-10-07 10:29:18
Context
2019-10-08
19:45
Store 64-bit offset values in osinst log files. Leaf check-in: 74d975c6 user: dan tags: osinst
2019-10-07
10:29
Avoid attempting to read 0 bytes from a file in the osinst vtab code. check-in: 1fb76c3e user: dan tags: osinst
2019-10-05
19:37
Fix a problem in Makefile.msc on this branch. check-in: ed3499a1 user: dan tags: osinst
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_osinst.c.

990
991
992
993
994
995
996

997

998
999
1000
1001
1002
1003
1004
    ){
      char buf[4];
      rc = p->pFd->pMethods->xRead(p->pFd, buf, 4, pCsr->iOffset+nRead);
      nRead += 4;
      if( rc==SQLITE_OK ){
        int nStr = get32bits((unsigned char *)buf);
        char *zStr = sqlite3_malloc(nStr+1);

        rc = p->pFd->pMethods->xRead(p->pFd, zStr, nStr, pCsr->iOffset+nRead);

        zStr[nStr] = '\0';
        nRead += nStr;

        if( eEvent==OS_OPEN ){
          int iFileid = get32bits(&pCsr->aBuf[4]);
          if( iFileid>=pCsr->nFile ){
            int nNew = sizeof(pCsr->azFile[0])*(iFileid+1);







>
|
>







990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
    ){
      char buf[4];
      rc = p->pFd->pMethods->xRead(p->pFd, buf, 4, pCsr->iOffset+nRead);
      nRead += 4;
      if( rc==SQLITE_OK ){
        int nStr = get32bits((unsigned char *)buf);
        char *zStr = sqlite3_malloc(nStr+1);
        if( nStr>0 ){
          rc = p->pFd->pMethods->xRead(p->pFd, zStr, nStr, pCsr->iOffset+nRead);
        }
        zStr[nStr] = '\0';
        nRead += nStr;

        if( eEvent==OS_OPEN ){
          int iFileid = get32bits(&pCsr->aBuf[4]);
          if( iFileid>=pCsr->nFile ){
            int nNew = sizeof(pCsr->azFile[0])*(iFileid+1);