summaryrefslogtreecommitdiff
path: root/ext/sqlite/pdo_sqlite2.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sqlite/pdo_sqlite2.c')
-rw-r--r--ext/sqlite/pdo_sqlite2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c
index 7788b3f8b3..0df676fec4 100644
--- a/ext/sqlite/pdo_sqlite2.c
+++ b/ext/sqlite/pdo_sqlite2.c
@@ -518,6 +518,10 @@ static char *make_filename_safe(const char *filename TSRMLS_DC)
if (strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+ if (!fullpath) {
+ return NULL;
+ }
+
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
efree(fullpath);
return NULL;