mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
- MFH: Fixed a segfault when reading from an HTTP stream.
This commit is contained in:
parent
f6853cccbd
commit
2ac81c2e6e
2 changed files with 11 additions and 1 deletions
|
@ -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) {
|
||||
|
|
10
ext/standard/tests/network/http-stream.phpt
Normal file
10
ext/standard/tests/network/http-stream.phpt
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue