diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-02-02 23:46:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-02 23:46:05 +0100 |
| commit | 6aadc40eacfc9fb7e10f81d3fb640be532830e5b (patch) | |
| tree | eff1315511835350d75ce40e074aae1767dbc83f /src | |
| parent | 42035701c02d15d586e762afa1db5c8b5c9eac39 (diff) | |
| parent | ee06c659f39c29b9a7dc47af687664d31cc5fc14 (diff) | |
| download | PROJ-6aadc40eacfc9fb7e10f81d3fb640be532830e5b.tar.gz PROJ-6aadc40eacfc9fb7e10f81d3fb640be532830e5b.zip | |
Merge pull request #1902 from rouault/fix_asan_issue_sqlite3_vfs
Fix ASAN issue with SQLite3VFS class (fixes #1901)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sqlite3_utils.cpp | 14 | ||||
| -rw-r--r-- | src/sqlite3_utils.hpp | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/sqlite3_utils.cpp b/src/sqlite3_utils.cpp index 673eb89c..3b1f1f8a 100644 --- a/src/sqlite3_utils.cpp +++ b/src/sqlite3_utils.cpp @@ -44,7 +44,7 @@ NS_PROJ_START // --------------------------------------------------------------------------- -SQLite3VFS::SQLite3VFS(sqlite3_vfs *vfs) : vfs_(vfs) {} +SQLite3VFS::SQLite3VFS(pj_sqlite3_vfs *vfs) : vfs_(vfs) {} // --------------------------------------------------------------------------- @@ -57,17 +57,7 @@ SQLite3VFS::~SQLite3VFS() { // --------------------------------------------------------------------------- -struct pj_sqlite3_vfs : public sqlite3_vfs { - std::string namePtr{}; - bool fakeSync = false; - bool fakeLock = false; -}; - -// --------------------------------------------------------------------------- - -const char *SQLite3VFS::name() const { - return static_cast<pj_sqlite3_vfs *>(vfs_)->namePtr.c_str(); -} +const char *SQLite3VFS::name() const { return vfs_->namePtr.c_str(); } // --------------------------------------------------------------------------- diff --git a/src/sqlite3_utils.hpp b/src/sqlite3_utils.hpp index ef141d1f..42ec33af 100644 --- a/src/sqlite3_utils.hpp +++ b/src/sqlite3_utils.hpp @@ -39,10 +39,20 @@ NS_PROJ_START //! @cond Doxygen_Suppress +// --------------------------------------------------------------------------- + +struct pj_sqlite3_vfs : public sqlite3_vfs { + std::string namePtr{}; + bool fakeSync = false; + bool fakeLock = false; +}; + +// --------------------------------------------------------------------------- + class SQLite3VFS { - sqlite3_vfs *vfs_ = nullptr; + pj_sqlite3_vfs *vfs_ = nullptr; - explicit SQLite3VFS(sqlite3_vfs *vfs); + explicit SQLite3VFS(pj_sqlite3_vfs *vfs); SQLite3VFS(const SQLite3VFS &) = delete; SQLite3VFS &operator=(const SQLite3VFS &) = delete; |
