1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Make the initial salt values in the WAL header random values, not zero.

FossilOrigin-Name: baa5eddd0539342945c14a2793c2579efb7e3b26
This commit is contained in:
drh
2010-07-07 21:06:48 +00:00
parent 12c7e1aba3
commit 2327f5a454
3 changed files with 11 additions and 11 deletions

View File

@@ -1222,7 +1222,6 @@ int sqlite3WalOpen(
pRet->pWalFd = (sqlite3_file *)&pRet[1];
pRet->pDbFd = pDbFd;
pRet->readLock = -1;
sqlite3_randomness(8, &pRet->hdr.aSalt);
pRet->zWalName = zWalName;
rc = sqlite3OsShmOpen(pDbFd);
@@ -2395,6 +2394,7 @@ int sqlite3WalFrames(
sqlite3Put4byte(&aWalHdr[4], WAL_MAX_VERSION);
sqlite3Put4byte(&aWalHdr[8], szPage);
sqlite3Put4byte(&aWalHdr[12], pWal->nCkpt);
sqlite3_randomness(8, pWal->hdr.aSalt);
memcpy(&aWalHdr[16], pWal->hdr.aSalt, 8);
walChecksumBytes(1, aWalHdr, WAL_HDRSIZE-2*4, 0, aCksum);
sqlite3Put4byte(&aWalHdr[24], aCksum[0]);