/ Check-in [77119785]
Login

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

Overview
Comment:Catch and report errors from sqlite3OsFullPathname().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 77119785c84ac7f416ed72c38c532399b6093d7a
User & Date: drh 2011-11-11 23:51:15
Context
2011-11-12
15:41
Merge the windows xSyscall enhancements into trunk. check-in: c1fab9ac user: drh tags: trunk
2011-11-11
23:51
Catch and report errors from sqlite3OsFullPathname(). check-in: 77119785 user: drh tags: trunk
00:27
Make sure a corrupt index does not cause a buffer overread in sqlite3VdbeRecordCompare(). check-in: 471cf0d8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  1772   1772         char *zFullPathname = sqlite3Malloc(nFullPathname);
  1773   1773         MUTEX_LOGIC( sqlite3_mutex *mutexShared; )
  1774   1774         p->sharable = 1;
  1775   1775         if( !zFullPathname ){
  1776   1776           sqlite3_free(p);
  1777   1777           return SQLITE_NOMEM;
  1778   1778         }
  1779         -      sqlite3OsFullPathname(pVfs, zFilename, nFullPathname, zFullPathname);
         1779  +      rc = sqlite3OsFullPathname(pVfs, zFilename, nFullPathname, zFullPathname);
         1780  +      if( rc ){
         1781  +        sqlite3_free(zFullPathname);
         1782  +        sqlite3_free(p);
         1783  +        return rc;
         1784  +      }
  1780   1785   #if SQLITE_THREADSAFE
  1781   1786         mutexOpen = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_OPEN);
  1782   1787         sqlite3_mutex_enter(mutexOpen);
  1783   1788         mutexShared = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
  1784   1789         sqlite3_mutex_enter(mutexShared);
  1785   1790   #endif
  1786   1791         for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){