Skip to content

Commit a073a59

Browse files
committed
Fix issue #221
In function sqlite3mc_initialize() the encryption VFS shim was added to the default VFS unconditionally. However, this fails if no default VFS is configured. Now it is first checked whether a default VFS is configured. Only then the encryption VFS shim is applied, so that sqlite3mc_initialize() does not fail.
1 parent ea0dfe7 commit a073a59

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sqlite3mc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,12 @@ sqlite3mc_initialize(const char* arg)
702702
*/
703703
if (rc == SQLITE_OK)
704704
{
705-
rc = sqlite3mc_vfs_create(NULL, 1);
705+
/* Check whether a default VFS is configured */
706+
if (sqlite3_vfs_find(NULL))
707+
{
708+
/* Add encryption VFS shim to default VFS */
709+
rc = sqlite3mc_vfs_create(NULL, 1);
710+
}
706711
}
707712
return rc;
708713
}

0 commit comments

Comments
 (0)