mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
fix bug #48518 (curl crashes when writing into invalid file handle)
This commit is contained in:
parent
433286f150
commit
c6cd73e7d1
1 changed files with 2 additions and 0 deletions
|
@ -1666,6 +1666,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
|||
switch (option) {
|
||||
case CURLOPT_FILE:
|
||||
if (((php_stream *) what)->mode[0] != 'r') {
|
||||
zend_list_addref(Z_LVAL_PP(zvalue));
|
||||
ch->handlers->write->fp = fp;
|
||||
ch->handlers->write->method = PHP_CURL_FILE;
|
||||
} else {
|
||||
|
@ -1676,6 +1677,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
|||
break;
|
||||
case CURLOPT_WRITEHEADER:
|
||||
if (((php_stream *) what)->mode[0] != 'r') {
|
||||
zend_list_addref(Z_LVAL_PP(zvalue));
|
||||
ch->handlers->write_header->fp = fp;
|
||||
ch->handlers->write_header->method = PHP_CURL_FILE;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue