- MFH: Fixed a segfault when reading from an HTTP stream.

This commit is contained in:
Derick Rethans 2007-11-29 12:28:15 +00:00
parent f6853cccbd
commit 2ac81c2e6e
2 changed files with 11 additions and 1 deletions

View File

@ -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 */ /* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || 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; reqok = 1;
} }
switch(response_code) { switch(response_code) {

View File

@ -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