diff options
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 2 | ||||
-rw-r--r-- | ext/sqlite/pdo_sqlite2.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 7ad7722c9d..3b611b28be 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -636,7 +636,7 @@ static struct pdo_dbh_methods sqlite_methods = { static char *make_filename_safe(const char *filename TSRMLS_DC) { - if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) { + if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c index 3e8d2f8f2b..18c5864a1b 100644 --- a/ext/sqlite/pdo_sqlite2.c +++ b/ext/sqlite/pdo_sqlite2.c @@ -515,7 +515,7 @@ static struct pdo_dbh_methods sqlite2_methods = { static char *make_filename_safe(const char *filename TSRMLS_DC) { - if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) { + if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { |