mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed a crash which happens if your READFUNCTION callback doesn't actually
return a string as promised.
This commit is contained in:
parent
ed2b1770ab
commit
2009e4e83b
1 changed files with 6 additions and 2 deletions
|
@ -500,8 +500,12 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
|||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
|
||||
length = -1;
|
||||
} else {
|
||||
memcpy(data, Z_STRVAL_P(retval_ptr), size * nmemb);
|
||||
length = Z_STRLEN_P(retval_ptr);
|
||||
if(Z_STRVAL_P(retval_ptr)) {
|
||||
memcpy(data, Z_STRVAL_P(retval_ptr), size * nmemb);
|
||||
length = Z_STRLEN_P(retval_ptr);
|
||||
} else {
|
||||
data = strdup("");
|
||||
}
|
||||
}
|
||||
|
||||
zval_ptr_dtor(argv[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue