summaryrefslogtreecommitdiff
path: root/ext/hash/hash.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-06 21:28:16 +0000
committerFelipe Pena <felipe@php.net>2011-06-06 21:28:16 +0000
commit32b5f8a1a3552f48d6e91c17b6d9d441c665a44d (patch)
treea6490eaed671ea190f7876994b35169200ff2df8 /ext/hash/hash.c
parenta311dc244353f0ed88a273056224ee5c97cc4011 (diff)
downloadphp-git-32b5f8a1a3552f48d6e91c17b6d9d441c665a44d.tar.gz
- Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
Diffstat (limited to 'ext/hash/hash.c')
-rw-r--r--ext/hash/hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index e994e9e157..1c2d4241c4 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -141,6 +141,9 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
RETURN_FALSE;
}
if (isfilename) {
+ if (CHECK_NULL_PATH(data, data_len)) {
+ RETURN_FALSE;
+ }
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
if (!stream) {
/* Stream will report errors opening file */