/ Check-in [56f609da]
Login

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

Overview
Comment:Use memcpy() rather than structure assignment so that memcmp() can later be used for comparison. Ticket [8550ecca70]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:56f609da4bfcc794e1f8573652dcde8515e87098
User & Date: drh 2009-10-07 23:42:25
References
2009-10-07
23:43 Fixed ticket [8550ecca]: findLockInfo uses memcmp on non-zeroed, = assigned struct plus 3 other changes artifact: 0eeaeb30 user: drh
Context
2009-10-08
01:43
Fix a segfault that can occur following an OOM fault while renaming a table holding foreign key constraints. check-in: 33973814 user: drh tags: trunk
2009-10-07
23:42
Use memcpy() rather than structure assignment so that memcmp() can later be used for comparison. Ticket [8550ecca70] check-in: 56f609da user: drh tags: trunk
18:41
Add some tests of statements in foreignkeys.html. check-in: 83828679 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  1024   1024       }
  1025   1025       if( pLock==0 ){
  1026   1026         pLock = sqlite3_malloc( sizeof(*pLock) );
  1027   1027         if( pLock==0 ){
  1028   1028           rc = SQLITE_NOMEM;
  1029   1029           goto exit_findlockinfo;
  1030   1030         }
  1031         -      pLock->lockKey = lockKey;
         1031  +      memcpy(&pLock->lockKey,&lockKey,sizeof(lockKey));
  1032   1032         pLock->nRef = 1;
  1033   1033         pLock->cnt = 0;
  1034   1034         pLock->locktype = 0;
  1035   1035         pLock->pNext = lockList;
  1036   1036         pLock->pPrev = 0;
  1037   1037         if( lockList ) lockList->pPrev = pLock;
  1038   1038         lockList = pLock;