/ Check-in [cf5c3642]
Login

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

Overview
Comment:Add assert()s to the implementation of xRead() in the built-in VFSes to verify that the offset parameter is always non-negative.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cf5c3642247fdd34d87f0368594cd7b8f081636a
User & Date: drh 2013-05-09 18:12:40
Context
2013-05-15
13:05
Add the rot13.c loadable extension. check-in: 8f9bd8e7 user: drh tags: trunk
08:00
Merge updates from trunk. check-in: 6fbad957 user: mistachkin tags: toTypeFuncs
2013-05-13
18:23
Candidate fixes for problems revealed by notify2.test. Notify2.test is still failing at this point. check-in: ea0428f9 user: dan tags: shared-cache-fixes
2013-05-10
02:11
Merge in the latest trunk changes. check-in: 5ed31c82 user: drh tags: nextgen-query-plan-exp
2013-05-09
23:40
Merge trunk changes into the sessions branch. check-in: 512f8a1e user: drh tags: sessions
18:12
Add assert()s to the implementation of xRead() in the built-in VFSes to verify that the offset parameter is always non-negative. check-in: cf5c3642 user: drh tags: trunk
14:20
Do not move WHERE clause terms inside OR expressions that are contained within an ON clause of a LEFT JOIN. Fix for ticket [f2369304e47167e3e]. check-in: 1128575d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  3148   3148     void *pBuf, 
  3149   3149     int amt,
  3150   3150     sqlite3_int64 offset
  3151   3151   ){
  3152   3152     unixFile *pFile = (unixFile *)id;
  3153   3153     int got;
  3154   3154     assert( id );
         3155  +  assert( offset>=0 );
         3156  +  assert( amt>0 );
  3155   3157   
  3156   3158     /* If this is a database file (not a journal, master-journal or temp
  3157   3159     ** file), the bytes in the locking range should never be read or written. */
  3158   3160   #if 0
  3159   3161     assert( pFile->pUnused==0
  3160   3162          || offset>=PENDING_BYTE+512
  3161   3163          || offset+amt<=PENDING_BYTE 

Changes to src/os_win.c.

  2153   2153   #endif
  2154   2154     winFile *pFile = (winFile*)id;  /* file handle */
  2155   2155     DWORD nRead;                    /* Number of bytes actually read from file */
  2156   2156     int nRetry = 0;                 /* Number of retrys */
  2157   2157   
  2158   2158     assert( id!=0 );
  2159   2159     assert( amt>0 );
         2160  +  assert( offset>=0 );
  2160   2161     SimulateIOError(return SQLITE_IOERR_READ);
  2161   2162     OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
  2162   2163              pFile->h, pBuf, amt, offset, pFile->locktype));
  2163   2164   
  2164   2165   #if SQLITE_MAX_MMAP_SIZE>0
  2165   2166     /* Deal with as much of this read request as possible by transfering
  2166   2167     ** data from the memory mapping using memcpy().  */