- Fixed bug #48240 (DBA Segmentation fault dba_nextkey). (Felipe)
- Fixed bug #48224 (Incorrect shuffle in array_rand). (Etienne)
- Fixed bug #48221 (memory leak when passing invalid xslt parameter). (Felipe)
+- Fixed bug #48207 (CURLOPT_(FILE|WRITEHEADER options do not error out when
+ working with a non-writable stream). (Ilia)
- Fixed bug #48206 (Iterating over an invalid data structure
with RecursiveIteratorIterator leads to a segfault). (Scott)
- Fixed bug #48204 (xmlwriter_open_uri() does not emit warnings on invalid
error = CURLE_OK;
switch (option) {
case CURLOPT_FILE:
- ch->handlers->write->fp = fp;
- ch->handlers->write->method = PHP_CURL_FILE;
+ if (((php_stream *) what)->mode[0] != 'r') {
+ ch->handlers->write->fp = fp;
+ ch->handlers->write->method = PHP_CURL_FILE;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ RETVAL_FALSE;
+ return 1;
+ }
break;
case CURLOPT_WRITEHEADER:
- ch->handlers->write_header->fp = fp;
- ch->handlers->write_header->method = PHP_CURL_FILE;
+ if (((php_stream *) what)->mode[0] != 'r') {
+ ch->handlers->write_header->fp = fp;
+ ch->handlers->write_header->method = PHP_CURL_FILE;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ RETVAL_FALSE;
+ return 1;
+ }
break;
case CURLOPT_INFILE:
zend_list_addref(Z_LVAL_PP(zvalue));