]> granicus.if.org Git - php/commitdiff
- Completed the fix for bug #52010
authorFelipe Pena <felipe@php.net>
Sun, 20 Jun 2010 14:12:06 +0000 (14:12 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 20 Jun 2010 14:12:06 +0000 (14:12 +0000)
# Fixing pdo drivers

ext/pdo_sqlite/sqlite_driver.c
ext/sqlite/pdo_sqlite2.c

index e0f53bebc09b41c5cc76d25fa11b807fbd8396ef..0f6f32310e2ab6876cb3be210f18fc3446142da6 100644 (file)
@@ -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) {
index 10f716f67319ae105c2f41ce1a180ac1fbef70ef..d7921e791d8ff164dd0dac009c14863c92b5feb6 100644 (file)
@@ -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) {