diff options
author | Johannes Schlüter <johannes@php.net> | 2012-06-22 12:50:30 +0200 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2012-06-22 12:50:30 +0200 |
commit | af516750ff32f69c1df10155fa8ec0c9cc5b70ff (patch) | |
tree | 5e663b048773da88b2b3ba24b507a06e61e43269 /ext/sqlite3/sqlite3.c | |
parent | 041dd77135c89af821b483a3c1f485bfaf6cfb50 (diff) | |
parent | 055ecbc62878e86287d742c7246c21606cee8183 (diff) | |
download | php-git-af516750ff32f69c1df10155fa8ec0c9cc5b70ff.tar.gz |
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
Improve check for :memory: pseudo-filename in SQlite
Conflicts:
ext/sqlite3/sqlite3.c
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r-- | ext/sqlite3/sqlite3.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index a420d5d708..4bf24fbc6a 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -114,7 +114,10 @@ PHP_METHOD(sqlite3, open) zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC); } - if (strncmp(filename, ":memory:", 8) != 0) { + if (strlen(filename) != filename_len) { + return; + } + if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) { if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); return; @@ -1959,7 +1962,7 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar switch (access_type) { case SQLITE_ATTACH: { - if (strncmp(arg3, ":memory:", sizeof(":memory:")-1) && *arg3) { + if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) { TSRMLS_FETCH(); #if PHP_API_VERSION < 20100412 |