summaryrefslogtreecommitdiff
path: root/ext/sqlite3/sqlite3.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-11-18 15:22:22 +0000
committerPierre Joye <pajoye@php.net>2010-11-18 15:22:22 +0000
commitce96fd6b0761d98353761bf78d5bfb55291179fd (patch)
tree0b66c858477f5ac7472bf35b842f89cdf4dce151 /ext/sqlite3/sqlite3.c
parent75631ab8ac231f141286428fd871ad31f2d71588 (diff)
downloadphp-git-ce96fd6b0761d98353761bf78d5bfb55291179fd.tar.gz
- fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r--ext/sqlite3/sqlite3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index f5d321dbf9..8dcce7ca65 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -114,6 +114,9 @@ PHP_METHOD(sqlite3, open)
zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
}
+ if (strlen(filename) != filename_len) {
+ return;
+ }
if (strncmp(filename, ":memory:", 8) != 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);