/ Check-in [153135bf]
Login

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

Overview
Comment:Avoid decrementing a pointer off the front end of the buffer in OP_MakeRecord.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 153135bfb3b8f7c407ccf36571e2d4d5afe28ea3
User & Date: drh 2016-04-07 14:16:16
Context
2016-04-07
18:42
Prevent the in-memory journal read cursor from entering an inconsistent state when it reads the last few bytes out of the journal file. Fix for ticket [7f7f8026eda38]. check-in: c4b9c611 user: drh tags: trunk
14:16
Avoid decrementing a pointer off the front end of the buffer in OP_MakeRecord. check-in: 153135bf user: drh tags: trunk
14:05
Instead of just commenting out the unneeded code in the previous check-in, remove it completely. check-in: 8415d484 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  2751   2751           len -= pRec->u.nZero;
  2752   2752         }
  2753   2753       }
  2754   2754       nData += len;
  2755   2755       testcase( serial_type==127 );
  2756   2756       testcase( serial_type==128 );
  2757   2757       nHdr += serial_type<=127 ? 1 : sqlite3VarintLen(serial_type);
  2758         -  }while( (--pRec)>=pData0 );
         2758  +    if( pRec==pData0 ) break;
         2759  +    pRec--;
         2760  +  }while(1);
  2759   2761   
  2760   2762     /* EVIDENCE-OF: R-22564-11647 The header begins with a single varint
  2761   2763     ** which determines the total number of bytes in the header. The varint
  2762   2764     ** value is the size of the header in bytes including the size varint
  2763   2765     ** itself. */
  2764   2766     testcase( nHdr==126 );
  2765   2767     testcase( nHdr==127 );