aboutsummaryrefslogtreecommitdiff
path: root/src/sqlite3_utils.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-02-28 17:41:45 +0100
committerGitHub <noreply@github.com>2020-02-28 17:41:45 +0100
commit1f3a571d32fb311a7bd4528b04071dbf332498c4 (patch)
treef71f30b6eb2d9a41f9c016e6e3c44024f4ad485c /src/sqlite3_utils.cpp
parente81f938f7c43a9209da74d0ec471a2ed9f08bfb0 (diff)
downloadPROJ-1f3a571d32fb311a7bd4528b04071dbf332498c4.tar.gz
PROJ-1f3a571d32fb311a7bd4528b04071dbf332498c4.zip
Avoid crash when running against SQLite3 binary built with -DSQLITE_OMIT_AUTOINIT (fixes #1932) (#1997)
Diffstat (limited to 'src/sqlite3_utils.cpp')
-rw-r--r--src/sqlite3_utils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sqlite3_utils.cpp b/src/sqlite3_utils.cpp
index 3b1f1f8a..7006674f 100644
--- a/src/sqlite3_utils.cpp
+++ b/src/sqlite3_utils.cpp
@@ -135,6 +135,9 @@ static int VFSCustomAccess(sqlite3_vfs *vfs, const char *zName, int flags,
std::unique_ptr<SQLite3VFS> SQLite3VFS::create(bool fakeSync, bool fakeLock,
bool skipStatJournalAndWAL) {
+ // Call to sqlite3_initialize() is normally not needed, except for
+ // people building SQLite3 with -DSQLITE_OMIT_AUTOINIT
+ sqlite3_initialize();
sqlite3_vfs *defaultVFS = sqlite3_vfs_find(nullptr);
assert(defaultVFS);