mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION
Previously this caused a SIGABRT. Closes GH-11639.
This commit is contained in:
parent
bbe72f160d
commit
3ccd8d7866
3 changed files with 63 additions and 2 deletions
|
@ -382,6 +382,11 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
|
|||
return rval;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(zend_fcall_info_init(&t->func_name, 0, &fci, &t->fci_cache, NULL, NULL) == FAILURE)) {
|
||||
php_error_docref(NULL, E_WARNING, "Cannot call the CURLMOPT_PUSHFUNCTION");
|
||||
return CURL_PUSH_OK;
|
||||
}
|
||||
|
||||
parent = Z_CURL_P(pz_parent_ch);
|
||||
|
||||
ch = init_curl_handle_into_zval(&pz_ch);
|
||||
|
@ -395,8 +400,6 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
|
|||
add_next_index_string(&headers, header);
|
||||
}
|
||||
|
||||
zend_fcall_info_init(&t->func_name, 0, &fci, &t->fci_cache, NULL, NULL);
|
||||
|
||||
zend_fcall_info_argn(
|
||||
&fci, 3,
|
||||
pz_parent_ch,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue