summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_sqlite3
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb_sqlite3')
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 602bd05fa2..9ed137c4f5 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -903,11 +903,16 @@ lsqlite3_initialize(struct lsqlite3_private *lsqlite3,
;
/* Skip protocol indicator of url */
- if ((p = strchr(url, ':')) == NULL) {
- return SQLITE_MISUSE;
- } else {
- ++p;
- }
+ if (strchr(url, ':')) {
+ if (strncmp(url, "sqlite://", 9) != 0) {
+ errno = EINVAL;
+ return SQLITE_MISUSE;
+ }
+ p = url + 9;
+ } else {
+ p = url;
+ }
+
/*
* See if we'll be creating a new database, or opening an existing one