summaryrefslogtreecommitdiff
path: root/ext/pgsql
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/pgsql
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/pgsql')
-rw-r--r--ext/pgsql/pgsql.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 90231c2ab5..3308e95716 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3339,6 +3339,10 @@ PHP_FUNCTION(pg_lo_import)
WRONG_PARAM_COUNT;
}
+ if (strlen(file_in) != name_len) {
+ RETURN_FALSE;
+ }
+
if (PG(safe_mode) &&(!php_checkuid(file_in, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
@@ -3476,6 +3480,10 @@ PHP_FUNCTION(pg_lo_export)
RETURN_FALSE;
}
+ if (strlen(file_out) != name_len) {
+ RETURN_FALSE;
+ }
+
if (PG(safe_mode) &&(!php_checkuid(file_out, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}