diff options
author | Wez Furlong <wez@php.net> | 2002-09-26 12:12:27 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-09-26 12:12:27 +0000 |
commit | c484eb8c97b084b09e7368e0ac0947c0c4f4f46f (patch) | |
tree | ce886b15b794f252f8665305037c8c7df3953f7c /ext/standard/file.h | |
parent | 1f227cd2e3470f984be84226def96fd0261ae000 (diff) | |
download | php-git-c484eb8c97b084b09e7368e0ac0947c0c4f4f46f.tar.gz |
Fix segfault in wrapper error log mechanism when errors are logged on
second and subsequent events.
Implement very simple recursion protection for user streams written
like this:
class urlEncodeStream {
var $fp = NULL;
function stream_open($path, $mode, $options, &$opened_path)
{
$this->fp = fopen($path, $mode); // <-- this recurses infinitely
return is_resource($this->fp);
}
}
file_register_wrapper('urlencode', 'urlEncodeStream');
$fp = fopen('urlencode:///tmp/outputfile.txt', 'w');
Noticed by: Yasuo.
Diffstat (limited to 'ext/standard/file.h')
-rw-r--r-- | ext/standard/file.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/standard/file.h b/ext/standard/file.h index 3990504509..4e5eba55dd 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -115,6 +115,7 @@ typedef struct { int auto_detect_line_endings; int default_socket_timeout; char *user_agent; + char *user_stream_current_filename; /* for simple recursion protection */ } php_file_globals; #ifdef ZTS |