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

Add test cases to test the libraries handling of corrupt wal-index headers.

FossilOrigin-Name: 9465b267d420120c050bbe4f143ac824146a9e4a
This commit is contained in:
dan
2010-05-06 11:32:09 +00:00
parent 8f6097c244
commit 9a6b4e9adb
5 changed files with 261 additions and 14 deletions

View File

@@ -694,10 +694,8 @@ static int walIteratorInit(Wal *pWal, WalIterator **pp){
nByte = sizeof(WalIterator) + (nSegment-1)*sizeof(struct WalSegment) + 512;
p = (WalIterator *)sqlite3_malloc(nByte);
if( !p ){
return SQLITE_NOMEM;
}
if( p ){
rc = SQLITE_NOMEM;
}else{
memset(p, 0, nByte);
p->nSegment = nSegment;
@@ -718,7 +716,7 @@ static int walIteratorInit(Wal *pWal, WalIterator **pp){
}
*pp = p;
return SQLITE_OK;
return rc;
}
/*