diff options
| author | Derick Rethans <derick@php.net> | 2007-11-29 12:28:15 +0000 |
|---|---|---|
| committer | Derick Rethans <derick@php.net> | 2007-11-29 12:28:15 +0000 |
| commit | 2ac81c2e6e29e868de4bb2f7636e4353e966696c (patch) | |
| tree | de55defd514dc58facec984bb6bd7e486c990d17 | |
| parent | f6853cccbd7d90f0ee68c52a46337c99dcc6b983 (diff) | |
| download | php-git-2ac81c2e6e29e868de4bb2f7636e4353e966696c.tar.gz | |
- MFH: Fixed a segfault when reading from an HTTP stream.
| -rw-r--r-- | ext/standard/http_fopen_wrapper.c | 2 | ||||
| -rw-r--r-- | ext/standard/tests/network/http-stream.phpt | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 5ab7459700..4845b27351 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -502,7 +502,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, } /* when we request only the header, don't fail even on error codes */ if ((options & STREAM_ONLY_GET_HEADERS) || - (php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval) == SUCCESS && zend_is_true(*tmpzval)) ) { + (context && php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval) == SUCCESS && zend_is_true(*tmpzval)) ) { reqok = 1; } switch(response_code) { diff --git a/ext/standard/tests/network/http-stream.phpt b/ext/standard/tests/network/http-stream.phpt new file mode 100644 index 0000000000..3db3eb372f --- /dev/null +++ b/ext/standard/tests/network/http-stream.phpt @@ -0,0 +1,10 @@ +--TEST-- +http-stream test +--FILE-- +<?php +$d = new DomDocument; +$e = $d->load("http://php.net/news.rss"); +echo "ALIVE\n"; +?> +--EXPECTF-- +ALIVE |
