force return NULL pointer on CODEC error
This commit is contained in:
parent
e0df9c6aa5
commit
dff5b42562
|
@ -714,6 +714,7 @@ static void* sqlite3Codec(void *iCtx, void *data, Pgno pgno, int mode) {
|
|||
if(rc != SQLITE_OK) { /* clear results of failed cipher operation and set error */
|
||||
sqlcipher_memset((unsigned char*) buffer+offset, 0, page_sz-offset);
|
||||
sqlcipher_codec_ctx_set_error(ctx, rc);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(pData, buffer, page_sz); /* copy buffer data back to pData and return */
|
||||
return pData;
|
||||
|
@ -739,6 +740,7 @@ static void* sqlite3Codec(void *iCtx, void *data, Pgno pgno, int mode) {
|
|||
if(rc != SQLITE_OK) { /* clear results of failed cipher operation and set error */
|
||||
sqlcipher_memset((unsigned char*)buffer+offset, 0, page_sz-offset);
|
||||
sqlcipher_codec_ctx_set_error(ctx, rc);
|
||||
return NULL;
|
||||
}
|
||||
return buffer; /* return persistent buffer data, pData remains intact */
|
||||
break;
|
||||
|
|
|
@ -111,7 +111,7 @@ do_test codec-error-journal-wal {
|
|||
execsql {
|
||||
PRAGMA cipher_fail_next_encrypt = 0;
|
||||
PRAGMA key = 'testkey';
|
||||
-- PRAGMA integrity_check;
|
||||
PRAGMA integrity_check;
|
||||
PRAGMA cipher_integrity_check;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue