Skip to content

Commit 06e922a

Browse files
committed
Remove unnecessary parameter checks in rekey()
Calling sqlite3_rekey_v2() with zKey == NULL && nKey == 0 is acceptable in order to fully decrypt the target database. Moreover, checking that the sqlite3* db handle is not NULL is also unnecessary (segfaulting is acceptable behavior in this case, in my opinion). Reported-by: johnfound
1 parent 4e3e471 commit 06e922a

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

sqleet.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,6 @@ int sqlite3_rekey_v2(sqlite3 *db, const char *zDbName,
559559
Codec *reader, *codec;
560560
Pgno pgno;
561561

562-
if (!db || (!nKey && !zKey))
563-
return SQLITE_ERROR;
564-
565562
sqlite3_mutex_enter(db->mutex);
566563
if (!(pBt = db->aDb[(nDb = db_index_of(db, zDbName))].pBt)) {
567564
rc = SQLITE_INTERNAL;

0 commit comments

Comments
 (0)