not a good fix, use IS_STRING to test.

-sterling
On Mar 12, 2004, at 11:08 AM, John Coggeshall wrote:

john Fri Mar 12 11:08:11 2004 EDT

Modified files:
/php-src/ext/curl interface.c
Log:
Fixed a crash which happens if your READFUNCTION callback doesn't actually
return a string as promised.



http://cvs.php.net/diff.php/php-src/ext/curl/interface.c? r1=1.34&r2=1.35&ty=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.34 php-src/ext/curl/interface.c:1.35
--- php-src/ext/curl/interface.c:1.34 Wed Mar 10 19:11:18 2004
+++ php-src/ext/curl/interface.c Fri Mar 12 11:08:11 2004
@@ -16,7 +16,7 @@
+---------------------------------------------------------------------- +
*/


-/* $Id: interface.c,v 1.34 2004/03/11 00:11:18 iliaa Exp $ */
+/* $Id: interface.c,v 1.35 2004/03/12 16:08:11 john Exp $ */

#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS

@@ -500,8 +500,12 @@
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]);

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to