]> granicus.if.org Git - php/commit
Fix segfault in wrapper error log mechanism when errors are logged on
authorWez Furlong <wez@php.net>
Thu, 26 Sep 2002 12:12:27 +0000 (12:12 +0000)
committerWez Furlong <wez@php.net>
Thu, 26 Sep 2002 12:12:27 +0000 (12:12 +0000)
commitc484eb8c97b084b09e7368e0ac0947c0c4f4f46f
treece886b15b794f252f8665305037c8c7df3953f7c
parent1f227cd2e3470f984be84226def96fd0261ae000
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.
ext/standard/file.c
ext/standard/file.h
main/streams.c
main/user_streams.c