aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/memvfs.c
diff options
context:
space:
mode:
authordrh <>2021-06-15 15:15:40 +0000
committerdrh <>2021-06-15 15:15:40 +0000
commita959bf53110bfada67a3a52187acd57aa2f34e19 (patch)
treef5dfb920eaa5a189f7cf6e181170caca57ec70a0 /ext/misc/memvfs.c
parent972da427490e1b4541322ce1af9a5e531946c656 (diff)
downloadsqlite-a959bf53110bfada67a3a52187acd57aa2f34e19.tar.gz
sqlite-a959bf53110bfada67a3a52187acd57aa2f34e19.zip
Add NULL checks on all sqlite3_vfs_find(0) calls. This is not strictly
necessary. There are no vulnerabilities here. However, adding these checks avoids unnecessary static analyzer complaints. [forum:/forumpost/ce1193be15|Forum post ce1193be15]. FossilOrigin-Name: 272a15b9f418fb0b31a9808f7c42c20cf52318035ff98935d8e8519634357e8d
Diffstat (limited to 'ext/misc/memvfs.c')
-rw-r--r--ext/misc/memvfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/misc/memvfs.c b/ext/misc/memvfs.c
index 27a61c35e..83fc9468e 100644
--- a/ext/misc/memvfs.c
+++ b/ext/misc/memvfs.c
@@ -559,6 +559,7 @@ int sqlite3_memvfs_init(
int rc = SQLITE_OK;
SQLITE_EXTENSION_INIT2(pApi);
mem_vfs.pAppData = sqlite3_vfs_find(0);
+ if( mem_vfs.pAppData==0 ) return SQLITE_ERROR;
mem_vfs.szOsFile = sizeof(MemFile);
rc = sqlite3_vfs_register(&mem_vfs, 1);
#ifdef MEMVFS_TEST